/* =========================================
   VARIABLES Y RESETEO
   ========================================= */
:root {
    --bg-main: #fdfdfd;
    --text-dark: #1a1a1a;
    --text-gray: #6b6b6b;
    --border-color: #eaeaea;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
html { scroll-behavior: smooth; }
body { background-color: var(--bg-main); color: var(--text-dark); line-height: 1.6; }

/* =========================================
   ESTRUCTURA PRINCIPAL (CENTRADO PERFECTO)
   ========================================= */
.main-layout {
    margin: 0 auto;
    padding: 80px 40px 80px 140px; /* 140px a la izquierda reserva el espacio del menú */
    max-width: 1100px; /* Ancho general para proyectos */
}

/* Secciones más estrechas (Journey, About, Toolkit) */
.section-narrow {
    max-width: 800px;
    margin: 0 auto 80px auto;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 30px;
    color: #111;
}

/* =========================================
   MENÚ FLOTANTE
   ========================================= */
.floating-sidebar {
    position: fixed; top: 50%; transform: translateY(-50%); left: 20px;
    background: #ffffff; width: 65px; padding: 20px 0;
    border-radius: 40px; box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    overflow: hidden; transition: width 0.4s cubic-bezier(0.25, 1, 0.5, 1); z-index: 1000;
}
.floating-sidebar:hover { width: 180px; }
.nav-links { list-style: none; display: flex; flex-direction: column; gap: 15px; }
.nav-links a { text-decoration: none; display: flex; align-items: center; color: #a3a3a3; padding: 10px 20px; width: 180px; transition: color 0.3s ease; }
.nav-links .icon { font-size: 1.5rem; flex-shrink: 0; transition: color 0.3s ease; }
.nav-links .text { margin-left: 15px; font-weight: 500; font-size: 0.95rem; opacity: 0; transition: opacity 0.3s ease; }
.floating-sidebar:hover .text { opacity: 1; transition-delay: 0.1s; }
.nav-links a:hover, .nav-links a:hover .icon { color: var(--text-dark); }

/* =========================================
   INICIO (HERO)
   ========================================= */



/* =========================================
   INICIO (HERO CARD ESTILO XIAOYANG)
   ========================================= */
.hero-card-section {
    margin-top: 40px;
    margin-bottom: 80px;
}

/* La tarjeta principal gigante */
.hero-main-card {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 32px;
    padding: 50px;
    display: flex;
    align-items: center;
    gap: 50px; /* Separación perfecta entre foto y texto */
    box-shadow: 0 10px 30px rgba(0,0,0,0.02);
}

/* --- Columna Izquierda (Foto) --- */
.hero-photo-side {
    position: relative;
    flex-shrink: 0; /* Evita que la foto se encoja */
}

/* Marco de la foto ligeramente rotado */
.photo-frame {
    width: 220px;
    height: 220px;
    border-radius: 20px; /* Bordes suaves */
    overflow: hidden;
    border: 6px solid #ffffff;
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
    transform: rotate(-3deg);
    transition: transform 0.4s ease;
}

.photo-frame:hover {
    transform: rotate(0deg) scale(1.02); /* Se endereza al pasar el mouse */
}

.photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* El sticker de saludo */
.hello-sticker {
    position: absolute;
    bottom: -15px;
    right: -20px;
    background-color: #ef4444; /* Rojo llamativo */
    color: white;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.1rem;
    font-family: 'Comic Sans MS', cursive, sans-serif;
    transform: rotate(8deg);
    box-shadow: 2px 5px 15px rgba(239, 68, 68, 0.3);
    z-index: 5;
}

/* --- Columna Derecha (Texto) --- */
.hero-text-side {
    flex: 1; /* Toma todo el espacio sobrante */
}

.hero-text-side h1 {
    font-size: 2.2rem;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: #10b981; /* Verde sutil para el cargo */
    font-weight: 600;
    margin-bottom: 20px;
}

.hero-text-side p {
    font-size: 1.05rem;
    color: #555;
    line-height: 1.7;
    margin-bottom: 15px;
}

/* Botones redondos de tecnologías */
.hero-stack-tags {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.hero-stack-tags span {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #555;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

/* --- Responsividad --- */
@media (max-width: 800px) {
    .hero-main-card {
        flex-direction: column; /* Se apila en móviles */
        padding: 30px;
        text-align: center;
    }
    .hero-photo-side {
        margin-bottom: 20px;
    }
    .hello-sticker {
        right: 0;
    }
    .hero-stack-tags {
        justify-content: center;
    }
}











.float-badge {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #111;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(255,255,255,1);
    animation: floating-badge 4s ease-in-out infinite;
}

.float-badge .material-symbols-rounded { font-size: 1.1rem; color: #111; }

.bw-1 { top: -5%; left: 2%; }
.bw-2 { bottom: 5%; right: 0%; }
.bw-3 { top: 15%; right: 2%; }

.bw-1 .float-badge { animation-delay: 0s; }
.bw-2 .float-badge { animation-delay: 1.2s; }
.bw-3 .float-badge { animation-delay: 0.6s; }

@keyframes floating-badge {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* 6. BOTÓN NEGRO CENTRAL (VER PROYECTO) */
.overlay-btn { 
    position: absolute;
    background-color: rgba(17, 17, 17, 0.95); 
    backdrop-filter: blur(5px);
    color: white; 
    padding: 14px 32px; 
    border-radius: 40px; 
    font-size: 0.95rem; 
    font-weight: 500; 
    text-decoration: none;
    opacity: 0; 
    transform: translateY(20px); 
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    z-index: 10;
}













.overlay-btn { 
    background-color: #111111; 
    color: white; 
    padding: 16px 36px; 
    border-radius: 40px; 
    font-size: 1.05rem; 
    font-weight: 500; 
    opacity: 0; 
    transform: scale(0.8) translateY(20px); 
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}










/* =========================================
   JOURNEY (EXPERIENCIA FINA)
   ========================================= */
.journey-wrapper { display: flex; flex-direction: column; }
.journey-row { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; border-bottom: 1px solid #f0f0f0; }
.journey-row:last-child { border-bottom: none; }
.j-col-left { display: flex; align-items: center; gap: 20px; }





.j-texts h4 { font-size: 1.05rem; color: #111; font-weight: 600; margin-bottom: 3px; }
/* Textos Frontales y alineación del ícono de la maleta */
.j-texts p { 
    font-size: 0.9rem; 
    color: #666; 
    display: flex; /* Convierte el párrafo en un contenedor flex */
    align-items: center; /* Centra el ícono verticalmente con el texto */
    gap: 6px; /* Añade una pequeña separación entre la maleta y las letras */
}

/* Nota: Asegúrate de mantener la clase .briefcase-icon-silhouette tal como está en tu CSS,
   al estar ahora dentro del <p>, heredará automáticamente el color gris (#666) del texto 
   gracias a su propiedad "background-color: currentColor;". */
.j-col-right { display: flex; align-items: center; gap: 20px; }
.j-time { font-size: 0.9rem; color: #888; }
.j-pill { font-size: 0.8rem; border: 1px solid #e5e5e5; padding: 4px 12px; border-radius: 20px; color: #666; background-color: #fff; }

/* =========================================
   ABOUT (TARJETA GRIS CERRADA)
   ========================================= */
.about-reference-card { background-color: #f8f9fa; border-radius: 32px; padding: 40px; display: flex; gap: 40px; align-items: center; border: 1px solid var(--border-color); }
.about-ref-left { position: relative; width: 200px; height: 180px; flex-shrink: 0; border-radius: 12px; border: 6px solid #ffffff; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
.about-ref-left img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.about-ref-badge { position: absolute; bottom: -15px; right: -25px; background: #ef4444; color: #ffffff; padding: 10px 20px; border-radius: 8px; transform: rotate(6deg); text-align: center; line-height: 1.2; box-shadow: 0 4px 10px rgba(239,68,68,0.2); }
.about-ref-badge span { display: block; font-weight: bold; font-size: 1.1rem; font-family: 'Comic Sans MS', cursive, sans-serif; }
.about-ref-badge small { font-size: 0.8rem; }
.about-ref-right p { font-size: 0.95rem; color: #555; line-height: 1.7; margin-bottom: 15px; }

/* =========================================
   TOOLKIT (STICKERS FLOTANTES)
   ========================================= */
.toolkit-canvas { position: relative; background-color: #f8f9fa; border: 1px solid var(--border-color); border-radius: 32px; height: 450px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.main-sticker { background: white; padding: 30px; border-radius: 20px; text-align: center; box-shadow: 0 15px 30px rgba(0,0,0,0.05); z-index: 10; max-width: 300px; border: 1px solid #f0f0f0; }
.icon-large { font-size: 3rem; margin-bottom: 10px; }
.main-sticker h3 { font-size: 1.2rem; margin-bottom: 10px; }
.main-sticker p { font-size: 0.9rem; color: var(--text-gray); }
.sticker { position: absolute; background: white; padding: 10px 20px; border-radius: 16px; font-size: 0.9rem; font-weight: 500; box-shadow: 0 10px 20px rgba(0,0,0,0.04); display: flex; align-items: center; gap: 8px; border: 1px solid #eaeaea; }
.rotate-left { transform: rotate(-5deg); } .rotate-right { transform: rotate(6deg); } .rotate-left-more { transform: rotate(-12deg); } .rotate-right-more { transform: rotate(15deg); }
.pos-1 { top: 15%; left: 10%; } .pos-2 { bottom: 20%; right: 10%; } .pos-3 { bottom: 15%; left: 15%; } .pos-4 { top: 20%; right: 15%; }
.floating { animation: float 6s ease-in-out infinite; }
.pos-2 { animation-delay: 1s; } .pos-3 { animation-delay: 2s; } .pos-4 { animation-delay: 0.5s; }
@keyframes float { 0% { transform: translateY(0px) rotate(auto); } 50% { transform: translateY(-10px) rotate(auto); } 100% { transform: translateY(0px) rotate(auto); } }

/* =========================================
   FOOTER (POST-IT)
   ========================================= */
.thank-you-canvas { background-color: #f1f5f9; border-radius: 32px; height: 300px; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.post-it-note { background-color: #fef08a; padding: 30px; width: 300px; border-radius: 2px 20px 2px 20px; box-shadow: 2px 10px 20px rgba(0,0,0,0.08); font-family: 'Comic Sans MS', cursive, sans-serif; font-size: 1rem; color: #333; position: absolute; left: 15%; transform: rotate(-5deg); z-index: 2; line-height: 1.5; }
.camera-icon { position: absolute; right: 15%; opacity: 0.5; }
.camera-icon span { font-size: 12rem; color: #cbd5e1; }

/* =========================================
   ANIMACIONES SCROLL
   ========================================= */
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* Responsivo */
@media (max-width: 900px) {
    .main-layout { padding: 40px 20px 80px 100px; }
    .journey-row { flex-direction: column; align-items: flex-start; gap: 15px; }
    .j-col-right { width: 100%; justify-content: space-between; }
    .about-reference-card { flex-direction: column; padding: 30px; }
    .about-ref-left { margin-bottom: 20px; }
}
/* =========================================
   EFECTO BARAJA (PURE CSS - PERFECTO)
   ========================================= */
/* REGLA DE ORO: Ningún contenedor padre debe ocultar el contenido, 
   o el efecto 'sticky' se romperá */
body, html, .main-layout {
    overflow: visible !important;
}

.stack-container {
    display: block; /* Diseño en bloque normal */
    position: relative;
    padding-bottom: 100px;
    margin-top: 80px;
}

.stack-card {
    position: sticky !important; /* El anclaje mágico */
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 40px;
    padding: 50px;
    
    height: 500px; /* Alto fijo necesario para el efecto */
    margin-bottom: 40px; /* Separación normal entre cartas */
    
    box-shadow: 0 -20px 50px rgba(0,0,0,0.08); /* Sombra profunda para el 3D */
    overflow: hidden;
}

/* LA ESCALERA DE POSICIONES: 
   Cada carta se detiene 30px más abajo que la anterior, 
   creando el efecto de "pestañas" apiladas. */
.card-1 { top: 100px; z-index: 10; }
.card-2 { top: 130px; z-index: 20; }
.card-3 { top: 160px; z-index: 30; }

/* La carta 4 (El Post-it de Agradecimiento) */
.card-4 { 
    top: 190px; 
    z-index: 40; 
    height: 350px; 
    padding: 0; 
}


/* =========================================
   DISEÑO INTERNO (Se mantiene igual, solo asegúrate de tenerlo)
   ========================================= */
.stack-text { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.stack-text h3 { font-size: 1.8rem; margin-bottom: 20px; color: #111; }
.stack-text p { font-size: 1.05rem; color: #555; margin-bottom: 15px; line-height: 1.6; }

.quote-box { margin-top: 20px; background-color: #f0fdf4; padding: 20px; border-radius: 16px; border-left: 4px solid #10b981; }
.quote-box p { color: #047857; font-style: italic; font-size: 0.95rem; margin-bottom: 10px; }
.quote-box strong { color: #065f46; font-size: 0.9rem; }

.stack-visual { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; background-color: #f8fafc; border-radius: 24px; overflow: hidden; }
.stack-main-img { width: 100%; height: 100%; object-fit: cover; }
.stack-badge { position: absolute; bottom: 20px; right: 20px; background: #ef4444; color: white; padding: 10px 20px; font-weight: bold; border-radius: 8px; transform: rotate(-5deg); }

.scatter-visual { background: transparent; }
.scatter-s, .polaroid { position: absolute; box-shadow: 0 10px 30px rgba(0,0,0,0.1); transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1); }
.scatter-s { width: 65%; border-radius: 12px; border: 4px solid white; }
.s-left { left: 5%; top: 20%; transform: rotate(-6deg); z-index: 1; }
.s-right { right: 5%; bottom: 20%; transform: rotate(4deg); z-index: 2; }
.scatter-s:hover { transform: scale(1.05) rotate(0deg); z-index: 10; }



.polaroid:hover { transform: scale(1.1) rotate(0deg); z-index: 10; }

.thank-you-canvas { width: 100%; height: 100%; background-color: #f1f5f9; display: flex; align-items: center; justify-content: center; position: relative; }
.post-it-note { background-color: #fef08a; padding: 30px; width: 300px; border-radius: 2px 20px 2px 20px; box-shadow: 2px 10px 20px rgba(0,0,0,0.08); font-family: 'Comic Sans MS', cursive, sans-serif; color: #333; position: absolute; left: 15%; transform: rotate(-5deg); z-index: 2; line-height: 1.5; }
.camera-icon { position: absolute; right: 15%; opacity: 0.5; }
.camera-icon span { font-size: 14rem; color: #cbd5e1; }

@media (max-width: 800px) {
    .stack-card { flex-direction: column; padding: 30px; height: auto; min-height: 0; position: relative !important; top: 0 !important; }
    .stack-visual { min-height: 300px; margin-top: 20px; }
}

/* =========================================
   Z-INDEX Y POSICIONES (LAS 4 CARTAS)
   ========================================= */
.stack-card {
    position: sticky;
    display: flex;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 40px;
    height: 500px; /* Alto fijo estricto para que el apilamiento sea perfecto */
    box-shadow: 0 -15px 40px rgba(0,0,0,0.04);
    overflow: hidden;
}

.card-1 { top: 100px; z-index: 10; }
.card-2 { top: 130px; z-index: 20; }
.card-3 { top: 160px; z-index: 30; }

/* La nueva carta 4 (Agradecimiento) */
.card-4 { 
    top: 190px; 
    z-index: 40; 
    display: block; /* A diferencia de las otras, esta usa todo el ancho */
    padding: 0; 
    position: relative;
}

.card-4-title {
    position: absolute;
    top: 40px;
    left: 50px;
    font-size: 1.8rem;
    color: #111;
    z-index: 10;
}

.thank-you-canvas {
    width: 100%;
    height: 100%;
    background-color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.post-it-note {
    background-color: #fef08a;
    padding: 30px;
    width: 300px;
    border-radius: 2px 20px 2px 20px;
    box-shadow: 2px 10px 20px rgba(0,0,0,0.08);
    font-family: 'Comic Sans MS', cursive, sans-serif;
    color: #333;
    position: absolute;
    left: 15%;
    transform: rotate(-5deg);
    z-index: 2;
    line-height: 1.5;
}

.camera-icon {
    position: absolute;
    right: 15%;
    opacity: 0.5;
}

.camera-icon span {
    font-size: 14rem; /* Cámara gigante */
    color: #cbd5e1;
}

/* =========================================
   AJUSTE FINAL: ACERCAR EL FOOTER
   ========================================= */
.stack-container {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

.card-4 {
    margin-bottom: 0 !important; /* Asegura que la última carta no empuje hacia abajo */
}



/* =========================================
   FOOTER FINAL (REDES, FIRMA Y CV)
   ========================================= */
.final-footer {
    display: flex;
    flex-direction: column;
    align-items: center; /* Todo centrado en el footer */
    padding: 60px 20px 80px 20px;
    margin-top: 40px;
    text-align: center;
}

/* Los 3 Botones principales (Píldoras) */
.footer-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap; /* Se adaptan en pantallas pequeñas */
    justify-content: center;
    margin-bottom: 50px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    border-radius: 40px; /* Forma de píldora */
    border: 1px solid var(--border-color);
    background-color: #ffffff;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.action-btn:hover {
    background-color: #f8fafc;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}

/* La firma */
.footer-signature {
    margin-bottom: 30px;
}

.footer-signature img {
    height: 70px; /* Tamaño ajustado para que se note bien */
    object-fit: contain;
}

/* Contenedor de las redes en la parte baja */
.footer-socials {
    display: flex;
    gap: 25px;
    margin-bottom: 30px;
}

.footer-socials a {
    color: var(--text-gray); /* Color gris elegante por defecto */
    transition: color 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Efecto al pasar el mouse por las redes */
.footer-socials a:hover {
    color: #111; /* Se oscurece */
    transform: scale(1.15) translateY(-3px); /* Hace un pequeño salto */
}

.footer-socials svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Textos de copyright */
.footer-copyright p {
    color: #888;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}










/* Textos dentro de la carta */
.stack-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stack-text h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #111;
}

.stack-text p {
    font-size: 1.05rem;
    color: #555;
    margin-bottom: 15px;
    line-height: 1.6;
}

/* Caja de cita (Post-it) */
.quote-box {
    margin-top: 20px;
    background-color: #f0fdf4;
    padding: 20px;
    border-radius: 16px;
    border-left: 4px solid #10b981;
}

.quote-box p { color: #047857; font-style: italic; font-size: 0.95rem; margin-bottom: 10px; }
.quote-box strong { color: #065f46; font-size: 0.9rem; }

/* Visuales (Fotos a la derecha) */
.stack-visual {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8fafc;
    border-radius: 24px;
    overflow: hidden;
}

.stack-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stack-badge {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: #ef4444;
    color: white;
    padding: 10px 20px;
    font-weight: bold;
    border-radius: 8px;
    transform: rotate(-5deg);
}

/* Fotos esparcidas dentro de la baraja */
.scatter-visual { background: transparent; }

.scatter-s, .polaroid {
    position: absolute;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.scatter-s { width: 65%; border-radius: 12px; border: 4px solid white; }
.s-left { left: 5%; top: 20%; transform: rotate(-6deg); z-index: 1; }
.s-right { right: 5%; bottom: 20%; transform: rotate(4deg); z-index: 2; }
.scatter-s:hover { transform: scale(1.05) rotate(0deg); z-index: 10; }



.polaroid:hover { transform: scale(1.1) rotate(0deg); z-index: 10; }

/* Responsivo para móviles */
@media (max-width: 800px) {
    .stack-card { flex-direction: column; padding: 30px; height: auto; min-height: 0; }
    .stack-visual { min-height: 300px; margin-top: 20px; }
}
/* =========================================
   AJUSTE FINAL: ACERCAR EL FOOTER
   ========================================= */
.stack-container {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

.card-4 {
    margin-bottom: 0 !important; /* Asegura que la última carta no empuje hacia abajo */
}

.final-footer {
    /* MAGIA AQUÍ: El margen negativo jala el footer hacia arriba, comiéndose el espacio blanco */
    margin-top: -150px; 
    
    padding-top: 60px;
    position: relative;
    z-index: 100; /* Garantiza que el footer quede por encima de cualquier espacio sobrante */
    background-color: var(--bg-main); /* Fondo sólido para que se vea limpio */
}


/* =========================================
   JOURNEY (DISEÑO Y EFECTO FLIP 3D)
   ========================================= */
/* =========================================
   JOURNEY (LISTA LIMPIA Y ACORDEÓN)
   ========================================= */
.journey-list {
    display: flex;
    flex-direction: column;
}

.j-item {
    border-bottom: 1px solid #eaeaea; /* Solo línea abajo, sin caja alrededor */
    cursor: none; /* Oculta el puntero normal del mouse para usar el nuestro */
}

/* El último elemento no necesita línea abajo */
.j-item:last-child {
    border-bottom: none;
}

.j-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0; /* Espaciado generoso */
    transition: opacity 0.3s ease;
}

/* Reducir ligeramente la opacidad de los que no están abiertos */
.j-item:hover .j-header {
    opacity: 0.8;
}

.j-col-left { display: flex; align-items: center; gap: 20px; }



.j-texts h4 { font-size: 1.1rem; color: #111; font-weight: 600; margin-bottom: 2px; }
.j-texts p { font-size: 0.9rem; color: #666; }

.j-col-right { display: flex; align-items: center; gap: 20px; white-space: nowrap; }
.j-time { font-size: 0.9rem; color: #888; }
.j-pill { font-size: 0.8rem; border: 1px solid #e5e5e5; padding: 4px 12px; border-radius: 20px; color: #666; background-color: #fff; }

/* EL ACORDEÓN MÁGICO (CSS Grid moderno) */
.j-body {
    display: grid;
    grid-template-rows: 0fr; /* Altura 0 por defecto */
    transition: grid-template-rows 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.j-item.open .j-body {
    grid-template-rows: 1fr; /* Se expande a la altura del contenido */
}

.j-body-inner {
    overflow: hidden; /* Oculta el texto mientras está cerrado */
}

/* La tarjeta de color interior */
.j-content-box {
    margin: 0 0 30px 68px; /* El 68px a la izquierda lo alinea con el texto, saltando el logo */
    padding: 25px 30px;
    border-radius: 16px;
    font-family: 'Comic Sans MS', cursive, sans-serif;
    font-size: 0.95rem;
    color: #333;
    line-height: 1.7;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.j-item.open .j-content-box {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   CURSOR PERSONALIZADO ("Flip me")
   ========================================= */
#custom-cursor {
    position: fixed;
    top: 0; left: 0;
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    pointer-events: none; /* Crucial: Evita que el cursor bloquee el clic */
    z-index: 9999;
    opacity: 0; /* Oculto por defecto */
    transform: translate(-50%, -50%) scale(0.5);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Clase que se activa con JS al pasar sobre la fila */
#custom-cursor.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

@media (max-width: 800px) {
    .j-header { flex-direction: column; align-items: flex-start; gap: 15px; }
    .j-col-right { width: 100%; justify-content: space-between; }
    .j-content-box { margin-left: 0; }
    #custom-cursor { display: none !important; } /* Desactiva en móviles */
    .j-item { cursor: pointer; } /* Devuelve el puntero normal en móviles */
}



/* El elemento que gira. Usamos CSS Grid para que el frente y el reverso 
   ocupen exactamente el mismo espacio sin desarmarse */
.flip-inner {
    position: relative;
    width: 100%;
    display: grid;
    grid-template-areas: "card";
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); /* Giro suave */
    transform-style: preserve-3d;
}




/* Textos (Se mantienen) */
.j-texts h4 { font-size: 1.05rem; color: #111; font-weight: 600; margin-bottom: 3px; }
.j-texts p { font-size: 0.9rem; color: #666; }
.j-col-right { display: flex; align-items: center; gap: 20px; white-space: nowrap; flex-shrink: 0; }
.j-time { font-size: 0.9rem; color: #888; }



/* SOLUCIÓN AL ICONO: Silueta rellena codificada en SVG */
.briefcase-icon-silhouette {
    width: 14px; height: 14px;
    /* Usamos currentColor para que combine con el texto verde o gris */
    background-color: currentColor; 
    /* Esta es la imagen SVG rellena y sencilla que me pasaste codificada */
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6 3.5V3a2 2 0 0 1 4 0v.5h3.5a1.5 1.5 0 0 1 1.5 1.5V13a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 1 13V5a1.5 1.5 0 0 1 1.5-1.5H6zM7 3.5h2V3a1 1 0 0 0-2 0v.5z' fill-rule='evenodd' clip-rule='evenodd'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6 3.5V3a2 2 0 0 1 4 0v.5h3.5a1.5 1.5 0 0 1 1.5 1.5V13a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 1 13V5a1.5 1.5 0 0 1 1.5-1.5H6zM7 3.5h2V3a1 1 0 0 0-2 0v.5z' fill-rule='evenodd' clip-rule='evenodd'/%3E%3C/svg%3E");
    -webkit-mask-size: contain; mask-size: contain;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: center; mask-position: center;
}



/* =========================================
   JOURNEY (EFECTO FLIP 3D Y ESTILOS) - CORREGIDO DEFINITIVO
   ========================================= */
.journey-wrapper { display: flex; flex-direction: column; gap: 15px; }

/* --- 1. ESTRUCTURA 3D (LA MAGIA DEL FLIP) --- */
.flip-row {
    perspective: 1000px; /* Profundidad 3D */
    cursor: pointer;
    position: relative;
    border-radius: 20px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Rebote al hacer hover */
.flip-row:hover {
    transform: translateY(-6px) scale(1.02);
    z-index: 10;
}

/* Contenedor que realmente gira */
.flip-inner {
    position: relative;
    width: 100%;
    display: grid;
    grid-template-areas: "card"; /* CRUCIAL: Apila el frente y el reverso uno encima del otro */
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d; /* CRUCIAL: Mantiene el 3D en los hijos */
}

/* Al dar clic (clase añadida por JS), gira 180 grados */
.flip-row.flipped .flip-inner {
    transform: rotateX(180deg);
}

/* Caras frontal y trasera */
.flip-front, .flip-back {
    grid-area: card; /* Ocupan exactamente el mismo espacio */
    backface-visibility: hidden; /* CRUCIAL: Oculta la cara cuando está de espaldas para que no se vea al revés */
    border-radius: 20px;
    width: 100%;
}

/* --- 2. CARA FRONTAL --- */
.flip-front {
    display: flex; justify-content: space-between; align-items: center;
    background-color: #ffffff;
    border-bottom: 1px solid #f0f0f0;
    padding: 24px 20px;
    transition: all 0.3s ease;
}

/* Sombra y contorno al pasar el mouse */
.flip-row:hover .flip-front {
    box-shadow: 0 15px 40px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
    border-bottom-color: transparent;
}

/* Logos Frontales */
.j-col-left { display: flex; align-items: center; gap: 20px; }
.j-logo { 
    width: 48px; height: 48px; border-radius: 12px; 
    background-color: #ffffff; border: 1px solid var(--border-color); 
    display: flex; align-items: center; justify-content: center; 
    flex-shrink: 0; overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,0.03); 
}
.j-logo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }

/* Textos Frontales */
.j-texts h4 { font-size: 1.05rem; color: #111; font-weight: 600; margin-bottom: 3px; }
.j-texts p { font-size: 0.9rem; color: #666; }
.j-col-right { display: flex; align-items: center; gap: 20px; white-space: nowrap; flex-shrink: 0; }
.j-time { font-size: 0.9rem; color: #888; }

/* --- 3. CARA TRASERA (LA NOTA DE COLOR) --- */
.flip-back {
    transform: rotateX(180deg); /* Empieza volteada de espaldas */
    display: flex; align-items: center; justify-content: flex-start;
    text-align: left; font-family: 'Comic Sans MS', cursive, sans-serif;
    color: #333; font-size: 0.95rem; line-height: 1.6;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.02);
    padding: 24px 100px 24px 30px; /* Espacio extra a la derecha para que el texto no pise el logo */
    position: relative; /* CRUCIAL: Para que el logo sticker no se escape de la caja */
}

/* El Logo Sticker en la esquina trasera */
.back-logo {
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%) rotate(8deg);
    width: 65px;
    height: 65px;
    background-color: #ffffff;
    border: 2px solid #1a1a1a;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 2px 4px 0px rgba(0,0,0,0.1);
    overflow: hidden;
    z-index: 5;
}
.back-logo img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }


/* --- 4. ICONOS DE ESTADO (MALETA EXACTA) --- */
.work-status-group {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px; border-radius: 20px;
    font-size: 0.8rem; font-weight: 600; border: 1px solid #e5e5e5;
}
.work-status-group.actual { background-color: rgba(16, 185, 129, 0.1); color: #10b981; border-color: rgba(16, 185, 129, 0.2); }
.work-status-group.passed { background-color: #f1f5f9; color: #666; }

.briefcase-icon-silhouette {
    width: 14px; height: 14px; background-color: currentColor; 
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6 3.5V3a2 2 0 0 1 4 0v.5h3.5a1.5 1.5 0 0 1 1.5 1.5V13a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 1 13V5a1.5 1.5 0 0 1 1.5-1.5H6zM7 3.5h2V3a1 1 0 0 0-2 0v.5z' fill-rule='evenodd' clip-rule='evenodd'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6 3.5V3a2 2 0 0 1 4 0v.5h3.5a1.5 1.5 0 0 1 1.5 1.5V13a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 1 13V5a1.5 1.5 0 0 1 1.5-1.5H6zM7 3.5h2V3a1 1 0 0 0-2 0v.5z' fill-rule='evenodd' clip-rule='evenodd'/%3E%3C/svg%3E");
    -webkit-mask-size: contain; mask-size: contain;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: center; mask-position: center;
}

/* --- RESPONSIVO --- */
@media (max-width: 800px) {
    .flip-front { flex-direction: column; align-items: flex-start; gap: 15px; }
    .j-col-right { width: 100%; justify-content: space-between; }
    .back-logo { width: 45px; height: 45px; right: 15px; }
    .flip-back { padding: 20px 60px 20px 20px; font-size: 0.85rem; }
    .flip-row:hover .flip-front { box-shadow: none; border: none; border-bottom: 1px solid #f0f0f0;}
}

/* =========================================
   CORRECCIÓN: ELIMINAR ESPACIO BLANCO FINAL (SCROLL FANTASMA)
   ========================================= */
html, body {
    height: auto !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

.main-layout {
    /* Quitamos el padding inferior gigante que tenía el layout principal */
    padding-bottom: 0 !important; 
    margin-bottom: 0 !important;
}

.final-footer {
    /* Dejamos solo un respiro mínimo debajo del copyright */
    padding-bottom: 20px !important; 
    margin-bottom: 0 !important;
}

/* Si la tarjeta de agradecimiento dejó un margen residual, lo matamos aquí */
.stack-container {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

.thank-you-canvas, 
.card-4 {
    margin-bottom: 0 !important;
}

/* Nos aseguramos de que el último párrafo de copyright no empuje nada */
.footer-copyright p:last-child {
    margin-bottom: 0 !important;
}



/* =========================================
   TARJETA 3: MÁS ALLÁ DEL CÓDIGO
   ========================================= */
.card-3 {
    display: flex;
    flex-direction: row; 
    align-items: center;
    padding: 40px 50px;
    gap: 40px;
}

.card-3-left {
    display: flex;
    flex-direction: column;
    flex: 1; 
    gap: 20px;
}

.card-3-right {
    position: relative;
    width: 180px; 
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- GALERÍA DE FOTOS ESPARCIDAS --- */
.photo-scatter-gallery {
    position: relative;
    height: 180px; /* Suficiente altura para que las fotos respiren */
    width: 100%;
}

.scatter-photo {
    position: absolute;
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 12px;
    border: 4px solid #ffffff;
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    background-color: #cbd5e1; 
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), z-index 0.2s, box-shadow 0.4s;
    cursor: pointer;
    top: 20px;
}

.scatter-photo:hover {
    transform: scale(1.15) rotate(0deg) translateY(-10px) !important;
    z-index: 10 !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}

.sp-1 { left: 0%; transform: rotate(-10deg); z-index: 1; }
.sp-2 { left: 16%; transform: rotate(5deg) translateY(10px); z-index: 2; }
.sp-3 { left: 32%; transform: rotate(-5deg) translateY(-5px); z-index: 3; }
.sp-4 { left: 48%; transform: rotate(8deg); z-index: 4; }
.sp-5 { left: 64%; transform: rotate(-8deg) translateY(15px); z-index: 2; }

/* --- REPRODUCTOR DE VINILO --- */
.music-player-widget {
    position: relative;
    width: 150px;
    height: 150px;
    cursor: pointer;
    z-index: 5;
}

.album-cover {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e293b, #0f172a); 
    background-image: url('../img/yo.jpg'); /* Opcional */
    background-size: cover;
    border-radius: 12px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-icon {
    color: white;
    font-size: 3.5rem;
    background: rgba(0,0,0,0.4); 
    border-radius: 50%;
    padding: 10px;
    backdrop-filter: blur(4px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s;
}

.music-player-widget:hover .play-icon {
    transform: scale(1.1);
    background: rgba(16, 185, 129, 0.9); 
}

.vinyl-record {
    position: absolute;
    width: 95%;
    height: 95%;
    top: 2.5%;
    left: 0;
    background-color: #111;
    border-radius: 50%;
    box-shadow: -5px 0 15px rgba(0,0,0,0.4);
    z-index: 2;
    background-image: repeating-radial-gradient(#111, #111 4px, #222 5px, #222 6px);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.vinyl-center {
    width: 35%;
    height: 35%;
    background-color: #ef4444; 
    border-radius: 50%;
    border: 2px solid #111;
}

.play-label {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    color: #111;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
    z-index: 5;
}

.music-player-widget:hover .vinyl-record {
    transform: translateX(65px) rotate(180deg); 
}

.music-player-widget:hover .play-label {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.vinyl-record.playing {
    animation: spin-vinyl 2.5s linear infinite; 
}

@keyframes spin-vinyl {
    from { transform: translateX(65px) rotate(0deg); }
    to { transform: translateX(65px) rotate(360deg); }
}

@media (max-width: 900px) {
    .card-3 { flex-direction: column; padding: 30px; }
    .scatter-photo { width: 90px; height: 90px; }
    .sp-1 { left: 0%; }
    .sp-2 { left: 15%; }
    .sp-3 { left: 30%; }
    .sp-4 { left: 45%; }
    .sp-5 { left: 60%; }
    .music-player-widget:hover .vinyl-record {
        transform: translateY(-50px) rotate(180deg);
    }
    @keyframes spin-vinyl-mobile {
        from { transform: translateY(-50px) rotate(0deg); }
        to { transform: translateY(-50px) rotate(360deg); }
    }
    .vinyl-record.playing { animation: spin-vinyl-mobile 2.5s linear infinite; }
}





/* --- REPRODUCTOR DE VINILO FUNCIONAL --- */
.music-player-widget {
    position: relative;
    width: 150px;
    height: 150px;
    cursor: pointer;
    z-index: 5;
}

.album-cover {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e293b, #0f172a); /* Fondo oscuro elegante */
    background-image: url('../img/vinilo.png'); /* Opcional: usa tu foto como carátula */
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #333;
}

.play-icon {
    color: white;
    font-size: 3.5rem;
    background: rgba(0,0,0,0.4); /* Círculo oscuro semitransparente para resaltar */
    border-radius: 50%;
    padding: 10px;
    backdrop-filter: blur(4px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s;
}

.music-player-widget:hover .play-icon {
    transform: scale(1.1);
    background: rgba(16, 185, 129, 0.9); /* Se vuelve verde al pasar el mouse */
}

/* El disco de vinilo */
.vinyl-record {
    position: absolute;
    width: 95%;
    height: 95%;
    top: 2.5%;
    left: 0;
    background-color: #111;
    border-radius: 50%;
    box-shadow: -5px 0 15px rgba(0,0,0,0.4);
    z-index: 2;
    background-image: repeating-radial-gradient(#111, #111 4px, #222 5px, #222 6px);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.vinyl-center {
    width: 35%;
    height: 35%;
    background-color: #ef4444; /* Etiqueta roja central */
    border-radius: 50%;
    border: 2px solid #111;
}

/* Tooltip "Juega mi favorito" */
.play-label {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    color: #111;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
    z-index: 5;
}

/* MAGIA HOVER Y ANIMACIÓN PLAY */
.music-player-widget:hover .vinyl-record {
    transform: translateX(65px) rotate(180deg); /* El vinilo sale a la derecha */
}

.music-player-widget:hover .play-label {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.vinyl-record.playing {
    animation: spin-vinyl 2.5s linear infinite; /* Animación de girar cuando suena */
}

@keyframes spin-vinyl {
    from { transform: translateX(65px) rotate(0deg); }
    to { transform: translateX(65px) rotate(360deg); }
}

/* --- RESPONSIVO PARA LA TARJETA 3 --- */
@media (max-width: 900px) {
    .card-3 { flex-direction: column; padding: 30px; }
    .scatter-photo { width: 90px; height: 90px; }
    .sp-1 { left: 0%; }
    .sp-2 { left: 15%; }
    .sp-3 { left: 30%; }
    .sp-4 { left: 45%; }
    .sp-5 { left: 60%; }
    
    /* En móviles el disco sale hacia arriba para no salirse de la pantalla */
    .music-player-widget:hover .vinyl-record {
        transform: translateY(-50px) rotate(180deg);
    }
    @keyframes spin-vinyl-mobile {
        from { transform: translateY(-50px) rotate(0deg); }
        to { transform: translateY(-50px) rotate(360deg); }
    }
    .vinyl-record.playing { animation: spin-vinyl-mobile 2.5s linear infinite; }
}












/* =========================================
   VARIABLES Y ESTILOS GLOBALES REFLEX
   ========================================= */
:root {
    --text-dark: #111111;
    --text-gray: #555555;
    --border-color: #f0f0f0;
    
    /* Colores Temáticos Fuertes y Vibrantes para Proyectos (XIAOYANG STYLE) */
    --theme-nippon: #60a5fa; /* Azul vibrante */
    --theme-nippon-soft: #dbeafe; /* Azul suave */
    --theme-aparthotel: #34d399; /* Verde vibrante */
    --theme-aparthotel-soft: #d1fae5; /* Verde suave */
}

/* Scroll suave para toda la web y padding-top para scroll-spy */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 60px; /* Evita que el título se esconda con el menú fixed */
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    margin: 0;
    background-color: #ffffff;
}

h1, h2, h3, h4 { color: var(--text-dark); letter-spacing: -0.5px; margin-top: 0; }

/* Utilitarios */
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.fade-in.visible { opacity: 1; transform: translateY(0); }
.section-narrow { max-width: 900px; margin-left: auto; margin-right: auto; padding: 0 20px; }





/* =========================================
   PROYECTOS DESTACADOS (DISEÑO XIAOYANG EXACTO)
   ========================================= */
#projects { margin-bottom: 100px; }
.section-title { font-size: 1.5rem; text-align: center; margin-bottom: 50px; font-weight: 600;}

/* 1. LA TARJETA (Altura controlada y proporciones exactas) */
.project-card { 
    position: relative;
    background-color: #ffffff;
    border: 1px solid rgba(12, 19, 27, 0.08); /* Borde sutil */
    border-radius: 24px; 
    padding: 35px 40px; 
    margin-bottom: 40px; 
    display: flex;
    flex-direction: column;
    align-items: center;
    /* EL SECRETO: Altura fija para que no se estire */
    height: 460px; 
    overflow: hidden;
    /* Sombra elegante base */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
}

/* Toda la tarjeta sube al pasar el mouse */
.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 10px 15px rgba(0, 0, 0, 0.04);
}

/* 2. LOS GRADIENTES DE FONDO (Ocultos por defecto) */
.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0; 
    transition: opacity 0.5s ease;
    z-index: 0;
}
/* Colores ligeramente más fuertes y asimétricos */
.card-nippon::before { background: linear-gradient(135deg, #509af5 0%, #eff6ff 40%, rgba(255,255,255,0) 80%); } /* Azul */
.card-aparthotel::before { background: linear-gradient(135deg, #f7a03c 0%, #fefce8 40%, rgba(255,255,255,0) 80%); } /* Amarillo/Naranja */
.card-green::before { background: linear-gradient(135deg, #2fe48f 0%, #ecfdf5 40%, rgba(255,255,255,0) 80%); } /* Verde */
.card-purple::before { background: linear-gradient(135deg, #af79e9 0%, #faf5ff 40%, rgba(255,255,255,0) 80%); } /* Morado */

.project-card:hover::before { opacity: 1; }





/* 3. TEXTOS (Animación en cascada y enfoque) */
.project-info { 
    position: relative;
    z-index: 2; 
    text-align: center; 
    margin-bottom: 25px; 
    flex-shrink: 0; 
}

/* Base de los textos: un poco más suaves por defecto */
.project-info h3 { 
    font-size: 1.35rem; 
    color: rgba(12, 19, 27, 0.8); /* Gris muy oscuro */
    font-weight: 600; 
    margin-bottom: 10px; 
    letter-spacing: -0.3px;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.project-info p { 
    font-size: 0.95rem; 
    color: rgba(12, 19, 27, 0.5); /* Gris medio */
    margin-bottom: 18px; 
    max-width: 580px; 
    margin-left: auto; 
    margin-right: auto; 
    line-height: 1.5;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.project-tags { 
    display: flex; 
    justify-content: center; 
    gap: 8px; 
    flex-wrap: wrap; 
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}


/* 3. TEXTOS (Efectos Dinámicos Xiaoyang+) */

/* Cuando pasas el mouse por la tarjeta... */
.project-card:hover .project-info h3 {
    /* Aplicamos el movimiento de vaivén */
    animation: moveLeftReturn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    /* Aplicamos el enfoque de color y espaciado */
    animation-delay: 0s;
    color: #111;
}

.project-card:hover .project-info p {
    /* El párrafo se mueve un poquito a la derecha para contrastar */
    transform: translateX(10px);
    color: rgba(12, 19, 27, 0.8);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.4s ease;
    transition-delay: 0.1s; /* Empieza un poquito después */
}

/* EFECTO EN LOS SPAN (TAGS) - Efecto "Giro y Brillo" */
.project-tags .tag {
    /* ... mantén tus estilos anteriores de .tag ... */
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.project-tags .tag:hover {
    /* Al pasar por encima del tag individual */
    transform: translateY(-5px) rotate(-3deg) scale(1.1); /* Salta, se inclina y crece */
    background-color: #111;
    color: #fff;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* EFECTO INDIVIDUAL EN LAS ETIQUETAS (TAGS) */
.project-tags .tag { 
    position: relative;
    border: 1px solid rgba(11, 19, 27, 0.15); 
    background: #fff; 
    color: #444; 
    padding: 4px 14px; 
    border-radius: 30px; 
    font-size: 0.75rem; 
    font-weight: 500;
    overflow: hidden; /* Para contener la animación de llenado */
    z-index: 1;
    cursor: pointer;
    transition: color 0.4s ease, border-color 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
}

/* El fondo que subirá al hacer hover (Pseudo-elemento) */
.project-tags .tag::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgb(12, 19, 27); /* Color oscuro de llenado */
    z-index: -1;
    transform: scaleY(0); /* Aplanado por defecto */
    transform-origin: bottom; /* Crece desde abajo */
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Lo que pasa cuando pones el ratón sobre un Tag específico */
.project-tags .tag:hover {
    color: #ffffff; /* Texto blanco */
    border-color: rgb(12, 19, 27);
    transform: translateY(-3px) scale(1.05); /* El botón salta hacia ti */
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.project-tags .tag:hover::before {
    transform: scaleY(1); /* El fondo oscuro sube y llena el botón */
}


/* Definición del efecto de vaivén hacia la izquierda */
@keyframes moveLeftReturn {
    0% { transform: translateX(0); }
    30% { transform: translateX(-25px); } /* Se desplaza a la izquierda */
    60% { transform: translateX(5px); }    /* Rebota un poquito a la derecha para dar inercia */
    100% { transform: translateX(0); }    /* Regresa al centro */
}

/* Efecto de "Brillo" o Revelación de color para las letras */
@keyframes textFocus {
    0% { color: rgba(12, 19, 27, 0.5); letter-spacing: -0.3px; }
    100% { color: rgba(12, 19, 27, 1); letter-spacing: 0.5px; } /* Se separan un poquito las letras */
}


/* 4. LA IMAGEN (Controlada para no romper la tarjeta) */
.project-visual { 
    position: relative;
    z-index: 2;
    flex-grow: 1; /* Toma el espacio restante */
    width: 100%;
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

.main-project-img { 
    /* El truco de Xiaoyang: Controlar el ALTO, no el ancho */
    max-height: 240px; 
    width: auto; 
    max-width: 85%; /* Límite por si la imagen es muy ancha */
    border-radius: 12px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.1); 
    transition: transform 0.5s ease, box-shadow 0.5s ease; 
}

.project-card:hover .main-project-img { 
    transform: scale(1.05); 
    box-shadow: 0 20px 40px rgba(0,0,0,0.15); 
}

/* 5. BADGES FLOTANTES */
.badge-wrapper {
    position: absolute;
    z-index: 3;
    opacity: 0; 
    transform: scale(0.9) translateY(10px); 
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none; 
}
.project-card:hover .badge-wrapper { opacity: 1; transform: scale(1) translateY(0); }

.float-badge {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #111;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #eaeaea;
    box-shadow: 0 8px 16px rgba(0,0,0,0.06);
    animation: floating-badge 4s ease-in-out infinite;
}
.float-badge .material-symbols-rounded { font-size: 1rem; color: #111; }

.bw-1 { top: -5%; left: 10%; animation-delay: 0s; }
.bw-2 { bottom: 10%; right: 5%; animation-delay: 1.2s; }
.bw-3 { top: 15%; right: 10%; animation-delay: 0.6s; }
@keyframes floating-badge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* 6. BOTÓN CENTRAL NEGRO */
.project-action-btn { 
    position: absolute;
    background-color: rgba(17, 17, 17, 0.95); 
    color: white; 
    padding: 12px 28px; 
    border-radius: 40px; 
    font-size: 0.9rem; 
    font-weight: 500; 
    text-decoration: none;
    opacity: 0; 
    transform: translateY(15px); 
    transition: all 0.4s ease;
    z-index: 10;
}
.project-card:hover .project-action-btn { opacity: 1; transform: translateY(0); }

/* Móviles */
@media (max-width: 800px) {
    .project-card { height: auto; padding: 30px 20px; }
    .main-project-img { max-height: 200px; }
    .badge-wrapper { display: none; }
    .project-action-btn { opacity: 1; transform: translateY(0); position: relative; margin-top: 20px; }
}








/* =========================================
   [2] REFLEX: LAYOUT DETALLES (Dos Columnas Fixed/Sticky)
   ========================================= */
/* Estructura Global Detalle */
.detail-body-layout { display: flex; }

/* 2.1 SIDEBAR IZQUIERDO FIJO */
.fixed-sidebar-reflex {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background-color: #ffffff;
    padding: 50px 40px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

/* Botón Circular Volver */
.reflex-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border: 1px solid #e5e5e5;
    border-radius: 50%;
    color: #555;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-bottom: 60px;
}
.reflex-back-btn:hover { border-color: #111; color: #111; transform: scale(1.05); }

/* ÍNDICE DE CONTENIDOS SCROLLSPY */
.reflex-toc ul { list-style: none; padding: 0; margin: 0; }
.reflex-toc li { margin-bottom: 18px; }
.reflex-toc a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #888; /* Gris apagado por defecto */
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}
.toc-num { font-size: 0.85rem; color: #a3a3a3; transition: color 0.3s; }
.reflex-toc a:hover, .reflex-toc a.active { color: #111; }
.reflex-toc a:hover .toc-num, .reflex-toc a.active .toc-num { color: #111; font-weight: 600;}

/* Línea animada a la izquierda */
.reflex-toc a::before {
    content: '';
    position: absolute;
    left: -25px;
    width: 12px;
    height: 2px;
    background-color: #111;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateX(-10px);
}
.reflex-toc a:hover::before, .reflex-toc a.active::before { opacity: 1; transform: translateX(0); }


/* 2.2 CONTENIDO PRINCIPAL DERECHO */
.reflex-main-content-area {
    margin-left: 280px; /* Espacio para Sidebar Fixed */
    flex: 1;
    padding: 60px 40px 100px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.reflex-content-container { width: 100%; max-width: 850px; } /* Ancho de lectura elegante */

/* Estilos de Contenido Detalle (Tipografía pequeña y limpia) */
.reflex-hero h1 { font-size: 3rem; letter-spacing: -1px; margin-bottom: 15px; color: #111; }
.reflex-hero p { font-size: 1.1rem; color: #555; max-width: 700px; margin-bottom: 30px; line-height: 1.6; }
.reflex-hero-tags { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 50px; }
.reflex-hero-tags span { border: 1px solid #eaeaea; background: #fff; padding: 6px 16px; border-radius: 20px; font-size: 0.85rem; color: #555; font-weight: 500;}

/* Imagen/Video Full */
.reflex-full-media { width: 100%; border-radius: 20px; box-shadow: 0 20px 40px rgba(0,0,0,0.1); margin-bottom: 80px; display: block; overflow: hidden; }
.reflex-full-media video, .reflex-full-media img { width: 100%; height: auto; display: block; }

/* Secciones de Artículo */
.reflex-article section { margin-bottom: 80px; scroll-margin-top: 60px; } /* CRUCIAL para ScrollSpy */
.reflex-section-meta { font-size: 1.1rem; color: #888; margin-bottom: 10px; font-weight: 400; font-family: monospace;}
.reflex-article h3 { font-size: 1.8rem; color: #111; margin-bottom: 25px; letter-spacing: -0.5px;}
.reflex-article p { font-size: 1.05rem; color: #444; line-height: 1.8; margin-bottom: 20px; }
.reflex-article ul { margin-bottom: 20px; padding-left: 20px; font-size: 1.05rem; color: #444; line-height: 1.8;}
.reflex-article li { margin-bottom: 10px; }
.reflex-content-img { width: 100%; border-radius: 12px; margin: 30px 0; border: 1px solid #eaeaea; box-shadow: 0 10px 25px rgba(0,0,0,0.05); }

/* Galería de cuadrícula */
.reflex-grid-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 40px 0; }
.reflex-grid-gallery img { width: 100%; border-radius: 16px; box-shadow: 0 10px 20px rgba(0,0,0,0.08); transition: transform 0.3s ease; }
.reflex-grid-gallery img:hover { transform: scale(1.02); }
.reflex-gallery-full-width { grid-column: 1 / -1; } /* Imagen a todo ancho dentro del grid */

/* Responsivo Detalle */
@media (max-width: 1000px) {
    body { flex-direction: column; }
    .fixed-sidebar-reflex { position: relative; width: 100%; height: auto; padding: 20px; border-bottom: 1px solid #eaeaea; display: flex; flex-direction: row; align-items: center; justify-content: space-between; }
    .reflex-back-btn { margin-bottom: 0; border: none; font-size: 0; width: auto; }
    .reflex-back-btn::after { content: ' Volver'; font-size: 1rem; margin-left: 5px; }
    .reflex-toc { display: none; } /* Ocultar sidebar toc en móvil */
    .reflex-main-content-area { margin-left: 0; padding: 40px 20px; }
    .reflex-hero h1 { font-size: 2.2rem; }
    .reflex-grid-gallery { grid-template-columns: 1fr; }
}




/* =========================================
   RESPONSIVO PARA MÓVILES (PROYECTOS)
   ========================================= */
@media (max-width: 900px) {
    .project-card { 
        height: auto; /* Quita la altura fija para que crezca según el contenido */
        padding: 40px 20px; 
    }
    
    /* El fondo suave siempre visible en móvil para darle vida */
    .project-card::before { opacity: 0.15; } 
    
    /* Las etiquetas flotantes se ocultan para limpiar la pantalla */
    .badge-wrapper { display: none; }
    
    /* La imagen se adapta al 100% del espacio móvil */
    .main-project-img { 
        max-height: none; 
        width: 100%; 
        margin-bottom: 20px; /* Separación con el botón */
    }
    
    /* Cambiamos la estructura visual para apilar la imagen y el botón */
    .project-visual {
        flex-direction: column;
    }
    
    /* El botón deja de flotar y se acomoda debajo de la imagen */
    .project-action-btn { 
        position: relative; /* ¡CRUCIAL! Lo saca del modo flotante */
        opacity: 1; /* Siempre visible */
        transform: translateY(0); 
        width: 100%; /* Botón de ancho completo en móvil se ve genial */
        text-align: center;
        box-sizing: border-box;
        margin-top: 10px;
    }
}