:root {
    --bg-paper: #fcf9f5; 
    --wood-texture: url('https://www.transparenttextures.com/patterns/dark-wood-grain.png'); 
    
    /* Madera más clara y cálida */
    --bento-frame: #3a2618; 
    --bento-box: #4a3220; 
    
    /* Contrastes mejorados */
    --ink-main: #ffffff; 
    --ink-muted: #dcd0c0; 
    
    /* Acentos más vivos para contrastar con la madera clara */
    --stamp-red: #e04a4a; 
    --gold: #f4c430;
    --jade: #66b27e;
    --indigo: #6e84ff;
    --copper: #d98d52;
    
    --font-sans: 'Inter', sans-serif;
    --font-serif: 'Noto Serif', serif;
}

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

body, html {
    height: 100vh; overflow: hidden; 
    background-color: var(--bg-paper);
    font-family: var(--font-sans); color: var(--ink-main);
    font-size: 14px;
}

/* --- SAKURA --- */
.sakura-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10; }
/* --- SAKURAS AVANZADAS --- */
.sakura {
    position: absolute;
    top: 0; left: 0;
    /* Forma de pétalo (una esquina redondeada y la opuesta en punta) */
    border-radius: 15px 0px 15px 0px; 
    /* Gradiente vibrante */
    background: linear-gradient(135deg, #ffb7c5, #ff6b8b);
    box-shadow: 0px 0px 10px rgba(255, 107, 139, 0.6);
    pointer-events: none; /* Asegura que el ratón las atraviese */
}
@keyframes fall { to { transform: translateY(100vh) rotate(360deg); } }
/* --- TABLERO BENTO (ACTUALIZADO A 4 COLUMNAS) --- */
.bento-full-screen { 
    height: 100vh; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    padding: 1rem; 
    position: relative; 
    z-index: 20; 
}

.bento-wood-frame {
    background-color: var(--bento-frame); 
    background-image: var(--wood-texture);
    padding: 12px; 
    border-radius: 16px;
    box-shadow: 15px 15px 40px rgba(0,0,0,0.25), inset 0 0 10px rgba(0,0,0,0.3);
    max-width: 1100px; /* Un poco más ancho para que las 4 cajas no se vean apretadas */
    width: 100%;
}

.bento-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* LA CLAVE: 4 COLUMNAS */
    grid-template-rows: auto auto; 
    gap: 12px;
}

/* CAJAS INDIVIDUALES */


/* --- DISTRIBUCIÓN DE ESPACIOS (4 ABAJO) --- */

/* Fila Superior: Perfil ocupa 3 y Proyectos ocupa 1 = 4 total */
.hero-box { 
    grid-column: span 3; 
    position: relative; 
    border-top: 3px solid var(--stamp-red); 
}

.project-box { 
    grid-column: span 1; 
    border-top: 3px solid var(--indigo); 
}

/* Fila Inferior: Cada una ocupa 1 columna = 4 total */
.exp-box { 
    grid-column: span 1; 
    border-top: 3px solid var(--jade); 
}

.cert-box { 
    grid-column: span 1; 
    border-top: 3px solid var(--gold); 
}

.lang-box { 
    grid-column: span 1; 
    border-top: 3px solid var(--gold); 
    position: relative;
}

.contact-box { 
    grid-column: span 1; 
    border-top: 3px solid var(--copper); 
    justify-content: space-between; 
}
h3 { font-family: var(--font-serif); font-size: 1.1rem; margin-bottom: 0.8rem; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 0.4rem; }
.accent-gold { color: var(--gold); }
.accent-jade { color: var(--jade); }
.accent-indigo { color: var(--indigo); }
.accent-copper { color: var(--copper); }

/* Tipografía Base */
h1 { font-family: var(--font-serif); font-size: 2.2rem; margin-bottom: 0.2rem; color: #fff; line-height: 1.1; }
h2 { font-size: 0.95rem; color: var(--ink-muted); font-weight: 500; margin-bottom: 0.8rem; }
p { color: var(--ink-muted); line-height: 1.5; font-size: 0.85rem; }

/* El Stack tipo CV */
.stack-line {
    margin-top: 0.8rem; padding: 8px;
    background: rgba(0,0,0,0.25); border-radius: 4px;
    font-family: monospace; font-size: 0.8rem; color: var(--gold);
    border: 1px solid rgba(0,0,0,0.4); text-align: center;
}

/* Redes Sociales */
.social-links { margin-top: 0.8rem; display: flex; gap: 1rem; justify-content: center; align-items: center;}
.social-links a { color: var(--ink-muted); transition: color 0.2s; width: 22px; height: 22px; }
.social-links a:hover { color: var(--copper); transform: scale(1.1); }

/* Sello Hanko */
.Hanko {
    position: absolute; top: 1.2rem; right: 1.2rem; width: 35px; height: 35px;
    border: 2px solid var(--stamp-red); color: var(--stamp-red);
    font-family: var(--font-serif); font-weight: bold; font-size: 1.2rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px; transform: rotate(8deg); opacity: 0.9;
}

/* Listas */
.lang-list, .exp-list { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; font-size: 0.8rem;}
.lang-list li { color: var(--ink-muted); }
.lang-list strong { color: #fff; }
.exp-list li { display: flex; justify-content: space-between; border-bottom: 1px dashed rgba(255,255,255,0.15); padding-bottom: 4px; }
.company { color: #fff; font-weight: 500; }
.role { color: var(--jade); }

/* Proyectos con Enlaces */
.project-list { display: flex; flex-direction: column; gap: 0.5rem; }
.project-item {
    display: flex; justify-content: space-between; align-items: center; text-decoration: none;
    background: rgba(0,0,0,0.2); padding: 8px 10px; border-radius: 4px;
    border-left: 2px solid transparent; transition: all 0.2s;
}
.project-item:hover { background: rgba(0,0,0,0.4); border-left-color: var(--indigo); transform: translateX(3px); }
.proj-info { display: flex; flex-direction: column; }
.proj-name { color: #fff; font-weight: 600; font-size: 0.8rem; }
.proj-desc { color: var(--ink-muted); font-size: 0.7rem; margin-top: 2px; }
.proj-link-icon { color: var(--indigo); font-weight: bold; font-size: 1.1rem; }

/* Header Cajas */
.box-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 0.5rem; }
.award { color: var(--gold); font-weight: 600; font-size: 0.75rem; background: rgba(0,0,0,0.25); padding: 2px 6px; border-radius: 4px;}

/* Formulario Contacto Corregido */
.contact-form { display: flex; flex-direction: column; gap: 0.5rem; }
.input-row { display: flex; gap: 0.5rem; }
.input-row input { width: 50%; }
input, textarea {
    background-color: rgba(0,0,0,0.25); border: 1px solid rgba(0,0,0,0.4);
    padding: 8px 10px; border-radius: 4px; color: #fff; font-family: inherit; font-size: 0.8rem; outline: none;
}
textarea { resize: none; height: 60px; }
input:focus, textarea:focus { border-color: var(--copper); }
button {
    background-color: var(--copper); color: #fff; border: none; padding: 8px; border-radius: 4px;
    font-weight: 600; cursor: pointer; font-family: inherit; font-size: 0.85rem; transition: background 0.2s;
}
button:hover { background-color: #ba7642; }

/* Responsive */
@media (max-width: 900px) { .bento-container { grid-template-columns: 1fr 1fr; } .hero-box { grid-column: span 2; } }
@media (max-width: 600px) { body { overflow-y: auto; height: auto; } .bento-full-screen { height: auto; } .bento-container { grid-template-columns: 1fr; } .hero-box, .contact-box { grid-column: span 1; } .input-row { flex-direction: column; } .input-row input { width: 100%; } }
/* --- FIX PARA IMAGEN DE PERFIL Y TÍTULO --- */
.hero-title-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.2rem;
}

.hero-title-wrapper h1 {
    margin-bottom: 0; /* Anula el margen inferior original para alinear con la foto */
}

.profile-pic {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 2px 2px 10px rgba(0,0,0,0.3);
}

/* --- AJUSTE PARA LA CAJA DE LENGUAJES (NUEVA CASA DEL HANKO) --- */
.lang-box { 
    grid-column: span 1; 
    border-top: 3px solid var(--gold); 
    position: relative; /* Necesario para que el Hanko se posicione relativo a esta caja */
}

/* Aseguramos que los enlaces sociales se vayan al fondo de la caja de Experiencia */
.social-links {
    margin-top: 1.5rem; /* Separación de la lista de experiencia */
    display: flex; 
    gap: 1rem; 
    justify-content: flex-start; /* Alineado a la izquierda para seguir la lectura */
    align-items: center;
}

/* Divisor para separar idiomas de certificados */
.cert-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 0.8rem 0;
}

.cert-list {
    list-style: none;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.cert-list li {
    color: var(--ink-muted);
    position: relative;
    padding-left: 12px;
}

.cert-list li::before {
    content: "•";
    color: var(--gold);
    position: absolute;
    left: 0;
}

.box-footer-link {
    font-size: 0.7rem;
    color: var(--gold);
    margin-top: 0.5rem;
    font-weight: 600;
    text-align: right;
    opacity: 0.8;
}

/* Asegurar que el icono de Platzi tenga el mismo estilo */
.social-links a svg {
    transition: all 0.2s;
}

.social-links a:hover svg {
    fill: var(--gold); /* El verde de Platzi es muy chillón, usamos tu dorado para consistencia */
}

/* --- BOTÓN WHATSAPP FLOTANTE --- */
.whatsapp-float {
  position: fixed;
  width: 60px;
  height: 60px;
  bottom: 40px;
  right: 40px;
  background-color: #25d366 !important;
  color: #FFF !important;
  border-radius: 50px;
  text-align: center;
  box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.4);
  z-index: 9999; /* Esto fuerza que esté por encima de todo */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
}

.whatsapp-float svg {
  width: 35px;
  height: 35px;
  fill: #FFF;
}

.whatsapp-float:hover {
  transform: scale(1.1) translateY(-5px);
  box-shadow: 0px 6px 20px rgba(37, 211, 102, 0.6);
}

:root {
    --bg-paper: #fcf9f5; 
    --wood-texture: url('https://www.transparenttextures.com/patterns/dark-wood-grain.png'); 
    --bento-frame: #3a2618; 
    --bento-box: #4a3220; 
    --ink-main: #ffffff; 
    --ink-muted: #dcd0c0; 
    --stamp-red: #e04a4a; 
    --gold: #f4c430;
    --jade: #66b27e;
    --indigo: #6e84ff;
    --copper: #d98d52;
    --font-sans: 'Inter', sans-serif;
    --font-serif: 'Noto Serif', serif;
}

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

body, html {
    min-height: 100vh; /* Permite crecer si el contenido lo requiere */
    overflow-x: hidden; /* Solo oculta el scroll horizontal */
    background-color: var(--bg-paper);
    font-family: var(--font-sans); 
    color: var(--ink-main);
    font-size: 14px;
}

/* --- TABLERO BENTO --- */
.bento-full-screen { 
    min-height: 100vh; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    padding: 2rem 1rem; /* Más padding para respirar */
    position: relative; 
    z-index: 20; 
}

.bento-wood-frame {
    background-color: var(--bento-frame); 
    background-image: var(--wood-texture);
    padding: 16px; /* Más espacio interior */
    border-radius: 16px;
    box-shadow: 15px 15px 40px rgba(0,0,0,0.25), inset 0 0 10px rgba(0,0,0,0.3);
    max-width: 1250px; /* Ensanchado para 4 columnas cómodas */
    width: 100%;
}

.bento-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 16px; /* Separación aumentada */
}

/* --- CAJAS INDIVIDUALES Y ANIMACIONES --- */

/* 1. Animación de Entrada (Fade In Up) */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}
/* --- CONFIGURACIÓN DE LA CAJA --- */
.bento-box {
    background-color: var(--bento-box); 
    background-image: var(--wood-texture);
    border-radius: 12px; /* Un poco más redondo para modernizarlo */
    padding: 1.8rem; 
    display: flex; 
    flex-direction: column; 
    justify-content: flex-start;
    border-bottom: 2px solid rgba(0,0,0,0.5); 
    border-right: 2px solid rgba(0,0,0,0.4);
    border-top: 1px solid rgba(255,255,255,0.05); 
    border-left: 1px solid rgba(255,255,255,0.03);
    box-shadow: inset 3px 3px 10px rgba(0,0,0,0.4);
    
    /* Animación de entrada */
    opacity: 0; 
    animation: fadeInUp 0.7s ease-out forwards;
    
    /* TRANSICIONES MEJORADAS PARA EL HOVER */
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), 
                box-shadow 0.3s ease, 
                filter 0.3s ease, 
                border-color 0.3s ease;
}

/* --- NUEVO EFECTO HOVER (Expansión + Iluminación) --- */
.bento-box:hover {
    transform: scale(1.02) translateY(-3px); /* Crece un 2% y sube ligeramente */
    box-shadow: 0 15px 35px rgba(0,0,0,0.6), /* Sombra exterior más profunda */
                inset 0 0 20px rgba(255,255,255,0.05); /* Resplandor interno */
    filter: brightness(1.15); /* Ilumina toda la caja un 15% */

    z-index: 10; /* Asegura que la caja que haces hover quede por encima de las demás */
}

/* Efecto cascada en la carga */
.bento-box:nth-child(1) { animation-delay: 0.1s; }
.bento-box:nth-child(2) { animation-delay: 0.2s; }
.bento-box:nth-child(3) { animation-delay: 0.3s; }
.bento-box:nth-child(4) { animation-delay: 0.4s; }
.bento-box:nth-child(5) { animation-delay: 0.5s; }



/* 3. Animación de Destello en Tiempo Real (Controlada por JS) */
@keyframes pulseGlow {
    0% { box-shadow: inset 3px 3px 10px rgba(0,0,0,0.3); }
    50% { box-shadow: 0 0 25px rgba(102, 178, 126, 0.6), inset 3px 3px 10px rgba(0,0,0,0.3); border-color: var(--jade); }
    100% { box-shadow: inset 3px 3px 10px rgba(0,0,0,0.3); }
}
.pulse-active {
    animation: pulseGlow 2s ease-in-out !important;
}

/* --- DISTRIBUCIÓN GRID --- */
.hero-box { grid-column: span 3; position: relative; border-top: 3px solid var(--stamp-red); }
.project-box { grid-column: span 1; border-top: 3px solid var(--indigo); }
.exp-box { grid-column: span 2; border-top: 3px solid var(--jade); }
.cert-box { grid-column: span 1; border-top: 3px solid var(--gold); }
.lang-box { grid-column: span 1; border-top: 3px solid var(--gold); position: relative; }

/* --- TIPOGRAFÍA Y ESTILOS INTERNOS --- */
h3 { font-family: var(--font-serif); font-size: 1.2rem; margin-bottom: 1rem; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 0.5rem; }
.accent-gold { color: var(--gold); }
.accent-jade { color: var(--jade); }
.accent-indigo { color: var(--indigo); }

.hero-title-wrapper { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
h1 { font-family: var(--font-serif); font-size: 2.4rem; color: #fff; line-height: 1.1; margin: 0; }
h2 { font-size: 1.05rem; color: var(--ink-muted); font-weight: 500; margin-bottom: 1rem; }
p { color: var(--ink-muted); line-height: 1.6; font-size: 0.9rem; }

.profile-pic { width: 55px; height: 55px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255, 255, 255, 0.1); box-shadow: 2px 2px 10px rgba(0,0,0,0.3); }
.stack-line { margin-top: 1rem; padding: 10px; background: rgba(0,0,0,0.25); border-radius: 4px; font-family: monospace; font-size: 0.85rem; color: var(--gold); border: 1px solid rgba(0,0,0,0.4); text-align: center; }

/* Proyectos */
.project-list { display: flex; flex-direction: column; gap: 0.8rem; }
.project-item { display: flex; justify-content: space-between; align-items: center; text-decoration: none; background: rgba(0,0,0,0.2); padding: 10px 12px; border-radius: 4px; border-left: 2px solid transparent; transition: all 0.2s; }
.project-item:hover { background: rgba(0,0,0,0.4); border-left-color: var(--indigo); transform: translateX(5px); }
.proj-name { color: #fff; font-weight: 600; font-size: 0.85rem; }
.proj-desc { color: var(--ink-muted); font-size: 0.75rem; margin-top: 4px; }
.proj-link-icon { color: var(--indigo); font-weight: bold; font-size: 1.2rem; }

/* Especialización & Lenguajes */
.cert-list, .lang-list { list-style: none; display: flex; flex-direction: column; gap: 0.8rem; font-size: 0.85rem; }
.cert-list li { color: var(--ink-muted); position: relative; padding-left: 14px; }
.cert-list li::before { content: "•"; color: var(--gold); position: absolute; left: 0; }
.lang-list li { color: var(--ink-muted); }
.lang-list strong { color: #fff; }
.award { color: var(--gold); font-weight: 600; font-size: 0.75rem; background: rgba(0,0,0,0.25); padding: 2px 6px; border-radius: 4px; margin-left: 5px;}
.Hanko { position: absolute; top: 1.5rem; right: 1.5rem; width: 35px; height: 35px; border: 2px solid var(--stamp-red); color: var(--stamp-red); font-family: var(--font-serif); font-weight: bold; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; border-radius: 6px; transform: rotate(8deg); opacity: 0.9; }

/* Botón WhatsApp */
.whatsapp-float { position: fixed; width: 60px; height: 60px; bottom: 30px; right: 30px; background-color: #25d366 !important; border-radius: 50px; display: flex; align-items: center; justify-content: center; box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.4); z-index: 9999; transition: transform 0.3s, box-shadow 0.3s; }
.whatsapp-float svg { width: 35px; height: 35px; fill: #FFF; }
.whatsapp-float:hover { transform: scale(1.1) translateY(-5px); box-shadow: 0px 6px 20px rgba(37, 211, 102, 0.6); }

/* --- RESPONSIVE DESIGN (Implementación Mobile) --- */

/* Clase utilitaria para la tabla de experiencia que inyectaremos en el HTML */
.exp-grid { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 16px 20px; align-items: start; width: 100%; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 15px; }

@media (max-width: 1024px) {
    .bento-container { grid-template-columns: 1fr 1fr; }
    .hero-box { grid-column: span 2; }
    .project-box { grid-column: span 2; }
    .exp-box { grid-column: span 2; }
}

@media (max-width: 768px) {
    .bento-container { grid-template-columns: 1fr; }
    .hero-box, .project-box, .exp-box, .cert-box, .lang-box { grid-column: span 1; }
    
    /* En móviles, la tabla de experiencia se convierte en filas apiladas */
    .exp-grid { grid-template-columns: 1fr; gap: 8px; padding-bottom: 15px; }
    .exp-grid > div { margin-bottom: 2px; }
    /* Ocultamos los separadores de la tabla en móvil para que no se vea rayado */
    .exp-grid .divider { display: none; } 
    
    .hero-title-wrapper { flex-direction: column-reverse; align-items: flex-start; gap: 10px; }
    h1 { font-size: 2rem; }
}