/* ==========================================================
   PORTAFOLIO - Carolina Hernandez
   Archivo de estilos principal.

   Para modificar colores, buscar la seccion "Variables CSS"
   al inicio. Ahi se cambian los colores globales del sitio.
   ========================================================== */

/* --- Clase para ocultar visualmente pero mantener accesible para buscadores y lectores de pantalla --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Variables CSS: colores y fuentes del sitio --- */
/* Tema claro minimalista — paleta lilac */
:root {
    --color-bg: #faf8fb;
    --color-surface: #f0edf4;
    --color-text: #2d2438;
    --color-text-secondary: #6b5f78;
    --color-accent: #9b7aa8;
    --color-accent-hover: #7d5e8a;
    --color-accent-light: #ede6f0;
    --color-border: #ddd4e4;
    --font-body: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    --shadow-sm: 0 1px 3px rgba(45, 36, 56, 0.08);
    --shadow-md: 0 4px 12px rgba(45, 36, 56, 0.1);
    --shadow-lg: 0 8px 30px rgba(45, 36, 56, 0.12);
    --radius: 8px;
    --max-width: 900px;
    --transition: 0.3s ease;
}

/* --- Reset: estilos base para todos los elementos --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
    transition: background-color var(--transition), color var(--transition);
}

/* --- Contenedor de secciones --- */
.section-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ========== NAVEGACION ========== */
/* Barra fija en la parte superior */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: transparent;
    border-bottom: none;
    transition: background var(--transition), box-shadow var(--transition);
}

/* Al hacer scroll, la barra gana fondo solido */
.navbar.scrolled {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

/* Cuando se hace scroll, la barra gana sombra */
.navbar.scrolled {
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 40px;
}

.nav-links a {
    text-decoration: none;
    color: var(--color-text);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: color var(--transition);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--color-accent);
}

/* Linea decorativa debajo del link activo — ahora animada en la seccion de animaciones */

/* --- Boton de cambio de idioma (ES/EN) --- */
/* Se muestra junto al boton de tema en la barra de navegacion */
.lang-toggle {
    background: none;
    border: 1.5px solid var(--color-border);
    color: var(--color-text-secondary);
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 14px;
    letter-spacing: 0.05em;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.lang-toggle:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
    background: var(--color-bg);
}

/* --- Boton de tema (deshabilitado, solo tema oscuro) --- */
.theme-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: color var(--transition), background var(--transition);
}

.theme-toggle:hover {
    color: var(--color-accent);
    background: var(--color-bg);
}

/* --- Subtitulo "Cosas de Datos" debajo del nombre --- */
.hero-tagline {
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--color-accent);
    margin-bottom: 24px;
}

/* ========== HERO / PRESENTACION ========== */
.hero {
    position: relative;
    padding: 140px 0 80px;
    min-height: 80vh;
    display: flex;
    align-items: center;
}

/* Canvas de partículas — fondo del hero */
#hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.hero-container {
    position: relative;
    z-index: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 48px;
    align-items: center;
    width: 100%;
}

/* Texto del hero ocupa la izquierda */
.hero-content {
    flex: 1;
}

/* Saludo / intro antes del nombre */
.hero-eyebrow {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--color-text-secondary);
    margin-bottom: 16px;
    max-width: 480px;
}

/* Foto circular a la derecha */
.hero-photo-wrap {
    flex-shrink: 0;
}

.hero-photo {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 6px var(--color-bg), 0 16px 48px rgba(45, 36, 56, 0.1);
}

/* --- Foto de perfil (usada en seccion Sobre mi) --- */
.hero-image {
    flex-shrink: 0;
}

.hero-image img,
.image-placeholder {
    width: 220px;
    height: 220px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: var(--shadow-md);
}

/* Placeholder que se muestra mientras no haya foto */
.image-placeholder {
    background: linear-gradient(135deg, #ddd4e4 0%, #9b7aa8 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    gap: 8px;
}

.image-placeholder i {
    font-size: 3rem;
    opacity: 0.9;
}

.image-hint {
    font-size: 0.7rem;
    opacity: 0.7;
}

/* --- Contenido del hero --- */
.hero-location {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}

.hero-location i {
    margin-right: 4px;
    color: var(--color-accent);
}

.hero-name {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 7vw, 4.5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 20px;
    color: var(--color-text);
}

.hero-title {
    font-family: var(--font-body);
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--color-accent);
    margin-bottom: 2px;
}

.hero-tagline {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text-secondary);
    max-width: 480px;
    margin-bottom: 24px;
}

/* Link dentro de la bio (ej: enlace a LinkedIn) */
.hero-bio a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition);
}

.hero-bio a:hover {
    border-bottom-color: var(--color-accent);
}

/* --- Iconos de redes sociales en el hero --- */
.hero-links {
    display: flex;
    gap: 16px;
}

.hero-links a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    text-decoration: none;
    font-size: 1.1rem;
    transition: all var(--transition);
}

.hero-links a:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* ========== SECCION DE SKILLS / EXPERTISE ========== */
.skills {
    padding: 24px 0 60px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 32px;
    color: var(--color-text);
}

.subsection-title {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 24px;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* --- Tags interactivos de expertise --- */
/* Al hacer clic aparece la descripcion debajo */
.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tag {
    padding: 10px 20px;
    border-radius: 24px;
    border: none;
    background: var(--tag-color);
    color: #1a2e3b;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.skill-tag:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.skill-tag.active {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    outline: 2px solid var(--color-text);
    outline-offset: 2px;
}

/* Descripciones que aparecen al hacer clic */
.skill-descriptions {
    margin-top: 20px;
    min-height: 60px;
}

.skill-desc {
    display: none;
    animation: fadeIn 0.3s ease;
}

.skill-desc.active {
    display: block;
}

.skill-desc p {
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--color-text-secondary);
    padding: 16px 20px;
    background: var(--color-surface);
    border-radius: var(--radius);
    border-left: 3px solid var(--color-accent);
    box-shadow: var(--shadow-sm);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Grid de herramientas tecnicas --- */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.tool-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--color-surface);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all var(--transition);
}

.tool-item:hover {
    border-color: var(--color-accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.tool-item i {
    font-size: 1.3rem;
    color: var(--color-accent);
}

/* ========== HERRAMIENTAS (seccion separada) ========== */
.tools-section {
    padding: 60px 0;
}

/* ========== PROYECTOS ========== */
.projects {
    padding: 60px 0;
}

.projects-intro {
    text-align: left;
    color: var(--color-muted);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 32px;
    max-width: 720px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

/* --- Tarjeta de proyecto --- */
.project-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--color-border);
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Imagen o placeholder del proyecto */
.project-image {
    height: 160px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
}

/* Cada tarjeta tiene un degradado diferente */
.project-card:nth-child(1) .project-placeholder {
    background: linear-gradient(135deg, #ddd4e4, #9b7aa8);
}
.project-card:nth-child(2) .project-placeholder {
    background: linear-gradient(135deg, #e6dced, #a886b5);
}
.project-card:nth-child(3) .project-placeholder {
    background: linear-gradient(135deg, #ede6f0, #b898c4);
}

.project-content {
    padding: 20px;
}

.project-content h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    margin-bottom: 8px;
    color: var(--color-text);
}

.project-content p {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--color-text-secondary);
    margin-bottom: 14px;
}

/* Tags dentro de cada tarjeta de proyecto */
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.project-tags span {
    padding: 4px 10px;
    background: var(--color-bg);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-secondary);
}

/* Fila con dos links: app en vivo + codigo */
.project-links-row {
    display: flex;
    gap: 16px;
    align-items: center;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-accent);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all var(--transition);
}

.project-link:hover {
    gap: 10px;
}

/* Link principal (app en vivo) con fondo */
.project-link.primary {
    background: var(--color-accent);
    color: white;
    padding: 6px 14px;
    border-radius: 16px;
    gap: 6px;
}

.project-link.primary:hover {
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

/* Imagen del proyecto clickeable */
.project-image-link a {
    display: block;
    width: 100%;
    height: 100%;
}

.project-image-link .project-placeholder {
    transition: opacity var(--transition);
}

.project-image-link:hover .project-placeholder {
    opacity: 0.85;
}

/* Texto "Ver app en vivo" dentro del placeholder */
.preview-hint {
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 4px;
    opacity: 0.9;
}

/* ========== PUBLICACIONES ========== */
/* Seccion con publicaciones seleccionadas como tarjetas clickeables */
.publications {
    padding: 60px 0;
    background: var(--color-surface);
}

.publications-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

/* Cada tarjeta es un enlace clickeable a la publicacion */
.publication-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--color-border);
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
}

.publication-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Imagen de portada de la publicacion */
.publication-image {
    height: 150px;
    overflow: hidden;
}

.publication-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition);
}

.publication-card:hover .publication-image img {
    transform: scale(1.03);
}

.publication-info {
    padding: 12px;
}

.publication-info h3 {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--color-text);
}

/* Organizacion y año de la publicacion */
.publication-meta {
    font-size: 0.82rem;
    color: var(--color-text-secondary);
}

/* Indicador de idioma disponible */
.publication-lang {
    font-size: 0.72rem;
    font-style: italic;
    color: var(--color-text-secondary);
    margin-top: 4px;
    opacity: 0.75;
}

/* Link a Google Scholar debajo de las tarjetas */
.publications-more {
    margin-top: 24px;
    text-align: center;
}

.publications-more a {
    color: var(--color-accent);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: all var(--transition);
}

.publications-more a:hover {
    opacity: 0.8;
}

/* --- Boton de descarga de CV --- */
.cv-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--color-accent-light);
    color: var(--color-accent);
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
    margin-top: 16px;
}

.cv-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ========== SOBRE MI ========== */
.about-me {
    padding: 60px 0;
    background: var(--color-surface);
}

/* Tarjeta con foto a la izquierda y texto a la derecha */
.about-card {
    display: flex;
    gap: 36px;
    align-items: flex-start;
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 32px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.about-image img,
.about-image .image-placeholder {
    width: 180px;
    height: 180px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: var(--shadow-sm);
}

.about-image {
    flex-shrink: 0;
}

.about-name {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 4px;
}

.about-role {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-accent);
    margin-bottom: 4px;
}

.about-location {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-bottom: 16px;
}

.about-location i {
    margin-right: 4px;
    color: var(--color-accent);
}

.about-bio {
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--color-text-secondary);
    margin-bottom: 20px;
}

/* Link dentro de la bio de Sobre mi */
.about-bio a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition);
}

.about-bio a:hover {
    border-bottom-color: var(--color-accent);
}

/* ========== CONTACTO ========== */
.contact {
    padding: 80px 0;
    text-align: center;
    background: var(--color-surface);
}

.contact-text {
    font-size: 1rem;
    color: var(--color-text-secondary);
    margin-bottom: 32px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.contact-links {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Boton principal de contacto */
.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--color-accent);
    color: #ffffff;
    text-decoration: none;
    border-radius: 24px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Botones secundarios de contacto */
.contact-btn.secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.contact-btn.secondary:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* ========== FOOTER ========== */
.footer {
    padding: 24px 0;
    text-align: center;
    border-top: 1px solid var(--color-border);
}

.footer p {
    font-size: 0.82rem;
    color: var(--color-text-secondary);
}

/* ========== ANIMACIONES DINAMICAS ========== */

/* Fade-in al scroll — las secciones aparecen suavemente */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Underline animado en links del nav */
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* ========== RESPONSIVE: MOVILES ========== */
/* Ajustes para pantallas menores a 768px */
@media (max-width: 768px) {
    /* Navegacion: siempre visible, compacta en movil */
    .nav-links {
        gap: 24px;
    }

    .nav-links a {
        font-size: 0.72rem;
    }

    /* Hero: foto arriba, texto abajo en movil */
    .hero-container {
        flex-direction: column-reverse;
        text-align: center;
    }

    .hero-photo {
        width: 180px;
        height: 180px;
    }

    .hero-eyebrow {
        margin-top: 24px;
    }

    .hero-tagline {
        max-width: 100%;
    }

    /* Sobre mi: foto arriba, texto abajo */
    .about-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .about-image img,
    .about-image .image-placeholder {
        width: 150px;
        height: 150px;
    }

    .about-bio {
        text-align: left;
    }

    .hero-links {
        justify-content: center;
    }

    /* Skills: tags en 2 columnas */
    .skill-tags {
        justify-content: center;
    }

    .skill-tag {
        font-size: 0.82rem;
        padding: 8px 16px;
    }

    /* Proyectos: una columna */
    .projects-grid {
        grid-template-columns: 1fr;
    }

    /* Publicaciones: una columna en movil */
    .publications-grid {
        grid-template-columns: 1fr;
    }

    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Pantallas muy pequenas */
@media (max-width: 480px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
