/* ==========================================
   Variables Globales y Reset (Tema Verde Jaguar)
========================================== */
:root {
    --tecnm-blue: #14532d;         /* Verde Jaguar Oscuro Principal */
    --tecnm-blue-dark: #064e3b;    /* Fondo profundo */
    --tecnm-blue-light: #16a34a;   /* Verde brillante de acento */
    --accent-glow: rgba(22, 163, 74, 0.4);
    --text-main: #2d3748;
    --text-muted: #4a5568;
    --white: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.88);
}

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

body {
    font-family: 'Montserrat', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
    background-color: var(--tecnm-blue-dark);
    color: var(--text-main);
}

/* ==========================================
   Fondo Dinámico con Formas Orgánicas (Blobs)
========================================== */
.background-design {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, var(--tecnm-blue) 0%, var(--tecnm-blue-dark) 100%);
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.45;
    animation: floatBlob 12s infinite alternate ease-in-out;
}

.blob-1 {
    width: 350px;
    height: 350px;
    background: var(--tecnm-blue-light);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: #059669;
    bottom: -150px;
    right: -150px;
    animation-delay: -6s;
}

@keyframes floatBlob {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, 50px) scale(1.1); }
}

/* ==========================================
   Contenedor Principal y Perspectiva 3D
========================================== */
.perspective-wrapper {
    perspective: 1000px;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 1rem;
}

.container {
    width: 100%;
    max-width: 450px;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out, box-shadow 0.3s ease;
    position: relative;
    overflow: visible !important; /* Vital para que el logo sobresalga hacia arriba */
}

.container:hover {
    box-shadow: 0 30px 60px rgba(20, 83, 45, 0.4);
}

/* ==========================================
   Foto de Portada y Perfil Superpuestos
========================================== */
.profile-cover {
    width: calc(100% + 4rem); 
    margin: -2rem -2rem 0 -2rem; 
    height: 150px; 
    position: relative;
    overflow: hidden;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
}

.cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    user-select: none;
}

/* Efecto Superpuesto del Logo/Perfil */
.profile-img-wrapper {
    position: relative;
    width: 110px;
    height: 110px;
    margin: -55px auto 0.8rem; /* Margen negativo para subir el logo y montarlo sobre la portada */
    z-index: 5;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.profile-img-wrapper:hover {
    transform: scale(1.06);
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--white);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    background-color: var(--white);
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.status-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 14px;
    height: 14px;
    background-color: #22c55e;
    border: 2px solid var(--white);
    border-radius: 50%;
    animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
    70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ==========================================
   Header Personalizado & Estatus en Vivo
========================================== */
.site-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 0.8rem;
}

.live-status-pill {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(34, 197, 94, 0.12);
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #15803d;
}

.live-dot {
    width: 7px;
    height: 7px;
    background-color: #22c55e;
    border-radius: 50%;
}

/* ==========================================
   Perfil y Biografía
========================================== */
.profile {
    text-align: center;
    margin-bottom: 1.5rem;
}

.profile-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--tecnm-blue);
    margin-bottom: 0.1rem;
    letter-spacing: -0.5px;
    min-height: 1.6rem;
}

.profile-title {
    font-size: 0.55rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 0.5rem;
}

.profile-bio {
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1.4;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
}

/* ==========================================
   Carrusel de Proyectos Destacados
========================================== */
.projects-section {
    margin-bottom: 1.5rem;
    background: rgba(20, 83, 45, 0.03);
    border: 1px solid rgba(20, 83, 45, 0.08);
    border-radius: 16px;
    padding: 0.9rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--tecnm-blue);
    margin-bottom: 0.6rem;
}

.projects-carousel {
    display: flex;
    align-items: center;
    position: relative;
}

.carousel-track-container {
    overflow: hidden;
    width: 100%;
}

.carousel-track {
    display: flex;
    transition: transform 0.4s ease-in-out;
}

.project-card {
    min-width: 100%;
    background: var(--white);
    padding: 0.8rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(20, 83, 45, 0.1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.project-card h3 {
    font-size: 0.85rem;
    color: var(--tecnm-blue);
    margin-bottom: 0.2rem;
}

.project-card p {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    line-height: 1.3;
}

.proj-tag {
    display: inline-block;
    background: rgba(22, 163, 74, 0.1);
    color: var(--tecnm-blue-light);
    font-size: 0.6rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
}

.carousel-btn {
    background: none;
    border: none;
    color: var(--tecnm-blue);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.3rem;
    transition: transform 0.2s ease;
}

.carousel-btn:hover {
    transform: scale(1.2);
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 0.5rem;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(20, 83, 45, 0.2);
    cursor: pointer;
    transition: background 0.3s ease;
}

.dot.active {
    background: var(--tecnm-blue);
    width: 14px;
    border-radius: 4px;
}

/* ==========================================
   Botones Interactivos con Efecto Shine
========================================== */
.links-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    padding: 0.9rem;
    background-color: var(--white);
    color: var(--tecnm-blue);
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 14px;
    border: 1px solid rgba(20, 83, 45, 0.15);
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
}

.link-btn i {
    position: absolute;
    left: 1.2rem;
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
}

.link-btn:hover {
    background-color: var(--tecnm-blue);
    color: var(--white);
    border-color: var(--tecnm-blue);
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 10px 20px rgba(20, 83, 45, 0.3);
}

.link-btn:hover i {
    transform: scale(1.2);
}

.link-btn:hover .btn-shine {
    left: 150%;
    transition: left 0.7s ease-in-out;
}

/* ==========================================
   Modal / Formulario de Mensaje Web
========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 78, 59, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: var(--white);
    width: 90%;
    max-width: 400px;
    padding: 1.5rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-header h3 {
    font-size: 0.95rem;
    color: var(--tecnm-blue);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text-muted);
    cursor: pointer;
}

.form-group {
    margin-bottom: 0.8rem;
}

.form-group label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid rgba(20, 83, 45, 0.2);
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--tecnm-blue);
}

.submit-msg-btn {
    width: 100%;
    padding: 0.8rem;
    background: var(--tecnm-blue);
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}

.submit-msg-btn:hover {
    background: var(--tecnm-blue-light);
}

.form-status {
    font-size: 0.75rem;
    text-align: center;
    margin-top: 0.5rem;
    color: var(--tecnm-blue);
}

/* ==========================================
   Footer Personalizado
========================================== */
.site-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.footer-divider {
    width: 40px;
    height: 3px;
    background-color: var(--tecnm-blue);
    margin: 0 auto 0.6rem;
    border-radius: 2px;
    opacity: 0.3;
}

.footer-copy {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
}

.footer-sub {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--tecnm-blue);
    margin-top: 0.1rem;
    letter-spacing: 0.5px;
}

/* ==========================================
   Animaciones de Intersección (Fade & Slide)
========================================== */
.fade-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s cubic-bezier(0.2, 0.8, 0.2, 1), transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.fade-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}