/* =========================================================================
   PAULA PORTFOLIO V2.0 - SISTEMA DE ESTILOS
   Estructura:
   1. Variables & Reset
   2. Componentes Principales (Hero, Tech Stack, Roles)
   3. Secciones de Contenido (Parallax, Marquee, Experience)
   4. Footer & Terminal Interactiva
   5. Chatbot Portal (Asistente IA)
   6. Sistema de Animaciones (Scroll Reveal)
   7. Media Queries (Diseño Responsivo) - AL FINAL DEL ARCHIVO
   ========================================================================= */

/* =========================================
   1. VARIABLES GLOBALES & RESET
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Paleta de colores */
    --black: #0a0a0a;
    --white: #f5f5f0;
    --cream: #e8e4dc;
    --accent: #ff3c00;
    /* Naranja corporativo */

    /* Transiciones */
    --transition-smooth: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

html {
    font-size: 16px;
    width: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    background: var(--black);
    color: var(--white);
    font-family: 'Syne', sans-serif;
    width: 100%;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* Bloqueo de scroll para el portal */
html.no-scroll,
body.no-scroll {
    overflow: hidden !important;
    height: 100% !important;
}

/* --- Pantalla de Carga (Intro) --- */
#intro {
    position: fixed;
    inset: 0;
    background: var(--black);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#intro.done {
    animation: introOut 1.2s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}

@keyframes introOut {
    0% {
        clip-path: inset(0 0 0 0);
    }

    100% {
        clip-path: inset(0 0 100% 0);
    }
}

.intro-word {
    position: absolute;
    font-size: clamp(1.44rem, 8vw, 8rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    opacity: 0;
    transform: translateY(50px) scale(0.95);
    text-align: center;
    padding: 0 5vw;
    white-space: nowrap;
    line-height: 1.1;
}

.intro-word.show {
    animation: wordIn var(--duration) ease forwards;
}

.intro-word.accent {
    color: var(--accent);
}

.intro-word.final {
    animation: wordFinal 1.8s ease forwards;
    letter-spacing: 0.02em;
    position: relative;
}

/* Efecto de cursor parpadeante para el typewriter */
.intro-word.typing {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
    animation: none !important;
}

.intro-word.typing::after {
    content: '|';
    display: inline-block;
    color: var(--cream);
    animation: cursorBlink 0.5s step-end infinite;
    margin-left: 4px;
    font-weight: 300;
}

@keyframes cursorBlink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* Fade out para la transición entre palabras */
.intro-word.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-30px);
    }
}

/* Subrayado animado para PAULA */
.intro-word.final::after {
    content: '';
    position: absolute;
    bottom: -0.05em;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--accent);
    transform: translateX(-50%);
    animation: underlineSweep 0.5s ease-out forwards 0.9s;
}

@keyframes underlineSweep {
    0% {
        width: 0;
    }

    100% {
        width: 40%;
    }
}

@keyframes wordIn {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
        filter: blur(8px);
    }

    25% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }

    75% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-40px) scale(0.98);
        filter: blur(4px);
    }
}

@keyframes wordFinal {
    0% {
        opacity: 0;
        transform: translateY(100px) scale(0.7);
        filter: blur(15px);
    }

    40% {
        opacity: 1;
        transform: translateY(-10px) scale(1.15);
        filter: blur(0);
    }

    60% {
        transform: translateY(5px) scale(1.1);
    }

    80% {
        transform: translateY(-3px) scale(1.12);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1.1);
        filter: blur(0);
    }
}

.skip-btn {
    position: fixed;
    bottom: 5vh;
    right: 5vw;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--white);
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 18px;
    cursor: pointer;
    z-index: 10000;
    transition: all 0.3s;
}

.skip-btn:hover {
    background: var(--white);
    color: var(--black);
}

.skip-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

/* =========================================
   2. COMPONENTES PRINCIPALES
   ========================================= */

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--white);
    color: var(--black);
    position: relative;
    overflow: hidden;
}

.hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10vh 8vw;
    position: relative;
    z-index: 2;
}

.hero-label {
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    opacity: 0.4;
    margin-bottom: 2rem;
}

.hero-title {
    font-size: clamp(3.5rem, 10vw, 10rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 0.85;
    margin-bottom: 1.5rem;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

.hero-title span {
    display: block;
}

/* Nombre principal: Paula */
.hero-title span:first-child {
    letter-spacing: -0.02em;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.03);
}

/* Rol: Developer (cursiva) */
.hero-title span:last-child {
    font-family: 'Instrument Serif', serif;
    font-weight: 400;
    font-style: italic;
    color: var(--accent);
    letter-spacing: 0.01em;
    margin-top: 0.05em;
}

.hero-subtitle {
    font-size: 1rem;
    opacity: 0.6;
    max-width: 350px;
    line-height: 1.7;
}

.hero-image-container {
    position: relative;
    overflow: hidden;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1) contrast(1.1);
}

.hero-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, var(--white) 0%, transparent 20%);
    pointer-events: none;
}

.hero-social {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.hero-social-link {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    border: 2px solid var(--accent);
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.hero-social-link svg {
    width: 18px;
    height: 18px;
}

.hero-social-link:hover {
    background: var(--accent);
    color: var(--white);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(255, 60, 0, 0.3);
}

.hero-scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 8vw;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition-smooth);
}

.scroll-text {
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.4;
    position: relative;
}

.scroll-text::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {

    0%,
    100% {
        transform: scaleX(0);
        transform-origin: left;
    }

    50% {
        transform: scaleX(1);
        transform-origin: left;
    }

    51% {
        transform-origin: right;
    }

    100% {
        transform: scaleX(0);
        transform-origin: right;
    }
}

.scroll-arrow {
    width: 24px;
    height: 24px;
    color: var(--accent);
    animation: scrollBounce 1.5s ease-in-out infinite;
}

@keyframes scrollBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(6px);
    }
}

/* --- Tech Stack (Bento Grid) --- */
.tech-stack-artistic {
    background: var(--black);
    padding: 15vh 6vw;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
}

.tech-bg-text {
    position: absolute;
    font-size: clamp(20rem, 40vw, 50rem);
    font-weight: 800;
    line-height: 0.8;
    letter-spacing: -0.05em;
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.03);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}

.tech-stack-container {
    position: relative;
    z-index: 2;
    max-width: 1400px;
    margin: 0 auto;
}

.tech-header {
    margin-bottom: 8vh;
    text-align: center;
}

.tech-eyebrow {
    font-size: 0.7rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    opacity: 0.4;
    display: block;
    margin-bottom: 1.5rem;
}

.tech-title {
    font-size: clamp(3rem, 10vw, 10rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 0.9;
}

.tech-title em {
    font-family: 'Instrument Serif', serif;
    font-weight: 400;
    font-style: italic;
    color: var(--accent);
}

.tech-bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.tech-bento-card {
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 2.5rem;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.tech-card-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, rgba(255, 60, 0, 0.15) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

.tech-bento-card:hover .tech-card-glow {
    opacity: 1;
}

.tech-bento-card:hover {
    border-color: rgba(255, 60, 0, 0.4);
    transform: translateY(-8px);
}

.tech-card-line {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 0;
    background: linear-gradient(90deg, var(--accent), rgba(255, 60, 0, 0.3));
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.tech-bento-card:hover .tech-card-line {
    width: 100%;
}

.tech-card-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tech-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--white);
    transition: var(--transition-smooth);
}

.tech-icon svg {
    width: 100%;
    height: 100%;
}

.tech-icon.python {
    color: #3776ab;
}

.tech-icon.sql {
    color: #00758f;
}

.tech-icon.mongodb {
    color: #47a248;
}

.tech-icon.postman {
    color: #ff6c37;
}

.tech-icon.bigdata {
    color: #8b5cf6;
}

.tech-icon.ai {
    color: #00d4aa;
}

.tech-bento-card:hover .tech-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 0 20px currentColor);
}

.tech-info h3 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
}

.tech-info p {
    font-size: 0.85rem;
    opacity: 0.5;
    font-family: 'Instrument Serif', serif;
    font-style: italic;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.2rem;
}

.tech-tags span {
    font-size: 0.65rem;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 60, 0, 0.1);
    border: 1px solid rgba(255, 60, 0, 0.2);
    color: var(--accent);
}

.tech-bento-card.featured {
    grid-row: span 2;
    padding: 3rem;
}

.tech-bento-card.wide {
    grid-column: span 2;
}

.tech-bento-card.wide .tech-card-content {
    flex-direction: row;
    align-items: center;
    gap: 2rem;
}

/* --- Roles Section --- */
.roles-mega {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.role-block {
    min-height: 100vh;
    padding: 8vh 6vw;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.role-block:nth-child(1),
.role-block:nth-child(4) {
    background: var(--accent);
    color: var(--black);
}

.role-block:nth-child(2),
.role-block:nth-child(3) {
    background: var(--black);
    color: var(--white);
}

.role-block-number {
    font-size: clamp(5rem, 18vw, 18rem);
    font-weight: 800;
    line-height: 0.75;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

.role-block-title {
    font-size: clamp(1.8rem, 4vw, 4rem);
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.8rem;
}

.role-block-title em {
    display: block;
    font-family: 'Instrument Serif', serif;
    font-weight: 400;
    font-size: 0.85em;
}

.role-block:nth-child(2) .role-block-title em,
.role-block:nth-child(3) .role-block-title em {
    color: var(--accent);
}

.role-block-desc {
    font-size: 0.9rem;
    line-height: 1.6;
    opacity: 0.6;
    max-width: 350px;
}

/* =========================================
   3. SECCIONES DE CONTENIDO
   ========================================= */

/* --- Parallax --- */
.parallax-section {
    height: 30vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: var(--black);
}

.parallax-text {
    font-size: clamp(2rem, 8vw, 8rem);
    font-weight: 800;
    white-space: nowrap;
    opacity: 0.12;
}

.parallax-text span {
    color: var(--accent);
    opacity: 1;
}

/* --- Marquee --- */
.marquee-section {
    background: var(--cream);
    padding: 5vh 0;
    overflow: hidden;
}

.marquee-track {
    display: flex;
    gap: 3rem;
    animation: marqueeScroll 20s linear infinite;
}

.marquee-track.reverse {
    animation-direction: reverse;
    margin-top: 1rem;
}

@keyframes marqueeScroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

.marquee-item {
    font-size: clamp(1.8rem, 5vw, 4.5rem);
    font-weight: 800;
    color: var(--black);
    opacity: 0.08;
    transition: all 0.4s ease;
    white-space: nowrap;
    /* Evita que las palabras se partan */
    flex-shrink: 0;
    /* Mantiene el ancho de cada palabra */
}

.marquee-item:hover {
    opacity: 1;
    color: var(--accent);
}

/* --- Experience --- */
.experience {
    background: var(--white);
    color: var(--black);
    padding: 15vh 6vw;
}

.exp-header {
    margin-bottom: 8vh;
}

.exp-header h2 {
    font-size: clamp(2.5rem, 8vw, 8rem);
    font-weight: 800;
    line-height: 0.85;
}

.exp-header h2 span {
    display: block;
    font-family: 'Instrument Serif', serif;
    font-weight: 400;
    font-style: italic;
    color: var(--accent);
}

.exp-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 2rem;
    padding: 3rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.exp-year {
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    opacity: 0.4;
}

.exp-company {
    font-size: clamp(1.4rem, 3.5vw, 3rem);
    font-weight: 800;
}

.exp-role {
    font-family: 'Instrument Serif', serif;
    font-style: italic;
    opacity: 0.6;
    margin-top: 0.5rem;
}

/* =========================================
   4. FOOTER & TERMINAL INTERACTIVA
   ========================================= */
.footer-terminal {
    background: var(--black);
    padding: 10vh 6vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
}

.terminal-window {
    width: 100%;
    max-width: 900px;
    background: #0d0d0d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.terminal-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #2d2d2d;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.terminal-title {
    flex: 1;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    font-family: monospace;
}

.terminal-buttons {
    display: flex;
    margin-left: auto;
}

.terminal-buttons span {
    width: 28px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
}

.btn-minimize::before {
    content: '—';
}

.btn-maximize::before {
    content: '□';
}

.btn-close::before {
    content: '✕';
}

.btn-close:hover {
    background: #e81123;
    color: white;
}

.terminal-body {
    padding: 2.5rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.95rem;
    line-height: 1.8;
}

.terminal-line {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 0.3rem;
    opacity: 0;
    animation: terminalFadeIn 0.5s ease forwards;
}

@keyframes terminalFadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.prompt {
    color: var(--accent);
    font-weight: 700;
}

.command {
    color: #88c0d0;
}

.terminal-output {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    opacity: 0;
    animation: terminalFadeIn 0.5s ease forwards;
}

.terminal-output.links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.terminal-link {
    color: #a3be8c;
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
}

.terminal-link:hover {
    color: var(--accent);
}

.terminal-output.stack {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.terminal-output.stack .tag {
    background: rgba(255, 60, 0, 0.15);
    color: var(--accent);
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.cursor {
    color: var(--accent);
    animation: cursorBlink 1s step-end infinite;
}

@keyframes cursorBlink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

.terminal-footer {
    width: 100%;
    max-width: 900px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
}

/* =========================================
   5. CHATBOT PORTAL (Asistente IA)
   ========================================= */

.chat-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    box-shadow: 0 4px 20px rgba(255, 60, 0, 0.4);
    z-index: 9000;
    transition: var(--transition-smooth);
    animation: chatFabPulse 3s ease-in-out infinite;
}

@keyframes chatFabPulse {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(255, 60, 0, 0.4), 0 0 0 0 rgba(255, 60, 0, 0.2);
    }

    50% {
        box-shadow: 0 4px 20px rgba(255, 60, 0, 0.4), 0 0 0 12px rgba(255, 60, 0, 0);
    }
}

.chat-fab svg {
    width: 28px;
    height: 28px;
    color: var(--white);
}

.chat-portal {
    position: fixed;
    inset: 0;
    background: rgba(2, 2, 8, 0.92);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-portal.active {
    opacity: 1;
    pointer-events: all;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 30px 20px 20px;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
}

.chat-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    overflow: hidden;
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-identity {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    margin-left: 15px;
}

/* Identidad y Estado */
.chat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.model-selector span {
    font-weight: 700;
    color: var(--white);
    font-size: 0.9rem;
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #28c840;
}

/* Botones de control */
.close-btn,
.history-btn {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
}

.close-btn svg,
.history-btn svg {
    width: 20px;
    height: 20px;
}

.close-btn:hover,
.history-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.close-btn {
    position: fixed;
    top: 20px;
    right: 20px;
}

.history-btn {
    position: fixed;
    top: 25px;
    left: 0;
    border-radius: 0 12px 12px 0;
}

/* Mover y estilizar botón cuando el sidebar está activo (Solo Desktop) */
@media (min-width: 601px) {
    .chat-sidebar.active~.chat-header .history-btn {
        left: 279px;
        /* Solapar el borde de 1px del sidebar para unificar */
        background: rgba(0, 0, 0, 0.95);
        /* Color exacto del sidebar */
        border-left: none;
        /* Eliminar borde separador */
        border-radius: 0 12px 12px 0;
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.3);
        color: var(--accent);
        /* Resaltar icono cuando está abierto */
    }
}

.chat-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10001;
    display: flex;
    flex-direction: column;
}

.chat-sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.new-chat-btn {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(255, 60, 0, 0.2);
}

.new-chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 60, 0, 0.3);
    filter: brightness(1.1);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

/* Scrollbars personalizadas para el Chat */
.chat-messages::-webkit-scrollbar,
.history-list::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track,
.history-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.chat-messages::-webkit-scrollbar-thumb,
.history-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.history-list::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 5px;
    font-size: 0.85rem;
}

.history-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
}

.history-item.active {
    background: rgba(255, 60, 0, 0.1);
    color: var(--accent);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.clear-conversations-btn {
    width: 100%;
    padding: 10px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.clear-conversations-btn:hover {
    color: #e81123;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
}

.message {
    max-width: 85%;
}

.message-ai {
    align-self: flex-start;
}

.message-user {
    align-self: flex-end;
}

.message-content {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.message-ai .message-content {
    background: rgba(255, 255, 255, 0.05);
}

/* Indicador de escritura animado */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    width: fit-content;
    align-items: center;
    height: 42px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: 0s;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-5px);
    }
}

.message-user .message-content {
    background: linear-gradient(135deg, var(--accent), #cc3000);
}

.chat-input-area {
    padding: 20px;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
}

.input-inner {
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 30px;
    padding: 8px 8px 8px 20px;
    transition: all 0.3s ease;
}

.input-inner:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 30px rgba(255, 60, 0, 0.15);
}

.input-field {
    flex: 1;
    background: none !important;
    border: none !important;
    color: var(--white) !important;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none !important;
    padding: 5px 0;
}

.send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.send-btn svg {
    width: 18px;
    height: 18px;
    /* Ajuste óptico para centrar el icono de avión */
    transform: translate(-1px, 1px);
}

.send-btn:hover {
    transform: scale(1.1);
}

.quick-suggestions {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    scrollbar-width: none;
}

.quick-suggestions::-webkit-scrollbar {
    display: none;
}

.suggestion {
    font-size: 0.75rem;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion:hover {
    background: rgba(255, 60, 0, 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

/* =========================================
   6. SISTEMA DE ANIMACIONES (Scroll Reveal)
   ========================================= */

.scroll-up {
    opacity: 0;
    transform: translateY(80px);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-left {
    opacity: 0;
    transform: translateX(-100px);
    transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-right {
    opacity: 0;
    transform: translateX(100px);
    transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-zoom {
    opacity: 0;
    transform: scale(0.5);
    transition: all 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-flip {
    opacity: 0;
    transform: perspective(1000px) rotateY(-40deg);
    transition: all 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-up.visible,
.scroll-left.visible,
.scroll-right.visible,
.scroll-zoom.visible,
.scroll-flip.visible {
    opacity: 1;
    transform: translate(0) scale(1) rotateY(0);
}

.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
}

.delay-4 {
    transition-delay: 0.4s;
}

/* =========================================
   7. MEDIA QUERIES (Consolidadas)
   ========================================= */

/* --- TABLETS & LAPTOPS PEQUEÑOS (1024px) --- */
@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
        grid-template-rows: 45vh auto;
    }

    .hero-image-container {
        order: -1;
    }

    .hero-image-overlay {
        background: linear-gradient(to top, var(--white) 0%, transparent 40%);
    }

    .tech-bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tech-bento-card.featured {
        grid-row: span 1;
    }

    .tech-bento-card.wide {
        grid-column: span 2;
    }

    .roles-mega {
        grid-template-columns: 1fr;
    }

    .role-block {
        min-height: 70vh;
    }
}

/* --- MÓVILES (600px) --- */
@media (max-width: 600px) {

    /* Intro */
    .intro-word {
        font-size: clamp(1.2rem, 8vw, 2.5rem);
        padding: 0 10px;
    }

    .skip-btn {
        bottom: 3vh;
        right: 3vw;
        padding: 8px 14px;
        font-size: 0.6rem;
    }

    /* Hero */
    .hero {
        display: flex;
        flex-direction: column;
        height: 100dvh;
        overflow: hidden;
    }

    .hero-image-container {
        height: 45vh;
        width: 100%;
        order: -1;
        min-height: auto;
    }

    .hero-content {
        padding: 4vh 5vw 4vh;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        flex: 1;
        gap: 0.8rem;
    }

    .hero-title {
        font-size: clamp(2.2rem, 10vw, 2.8rem);
        line-height: 1;
        margin-bottom: 0.2rem;
        opacity: 1 !important;
        transform: none !important;
    }

    .hero-label {
        margin-bottom: 0.2rem;
        font-size: 0.8rem;
        opacity: 1 !important;
        transform: none !important;
    }

    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
        opacity: 1 !important;
        transform: none !important;
    }

    /* Social Icons at the bottom on load */
    .hero-social {
        margin-top: auto;
        margin-bottom: 2rem;
        gap: 0.8rem;
        opacity: 1 !important;
        transform: none !important;
    }

    .hero-social-link {
        width: 38px;
        height: 38px;
    }

    .hero-scroll-indicator {
        display: none;
    }

    /* Tech Stack */
    .tech-stack-artistic {
        padding: 10vh 5vw;
    }

    .tech-bento-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .tech-bento-card.featured,
    .tech-bento-card.wide {
        grid-column: span 1;
        grid-row: span 1;
    }

    .tech-bento-card.wide .tech-card-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .tech-bg-text {
        font-size: clamp(8rem, 30vw, 15rem);
    }

    /* Roles */
    .role-block {
        min-height: auto;
        padding: 8vh 5vw;
    }

    /* Alternancia de colores para evitar bloques iguales seguidos en una sola columna */
    .role-block:nth-child(1),
    .role-block:nth-child(3) {
        background: var(--accent);
        color: var(--black);
    }

    .role-block:nth-child(2),
    .role-block:nth-child(4) {
        background: var(--black);
        color: var(--white);
    }

    .role-block:nth-child(3) .role-block-title em {
        color: var(--black);
    }

    .role-block:nth-child(4) .role-block-title em {
        color: var(--accent);
    }

    /* Experience */
    .exp-item {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    /* Footer & Window */
    .terminal-body {
        padding: 1.5rem;
        font-size: 0.85rem;
    }

    .terminal-output.links {
        flex-direction: column;
        gap: 0.8rem;
    }

    .terminal-footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    /* Chatbot Mobile */
    .chat-fab {
        width: 52px;
        height: 52px;
        bottom: 20px;
        right: 20px;
    }

    .chat-portal {
        background: #050505;
    }

    .chat-header {
        padding: 50px 20px 10px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .chat-identity {
        margin-left: 0;
        justify-content: center;
    }

    .chat-avatar {
        width: 50px;
        height: 50px;
    }

    .close-btn {
        position: absolute;
        top: 20px;
        right: 20px;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        padding: 0;
    }

    .history-btn {
        position: absolute;
        top: 20px;
        left: 20px;
        width: 40px;
        height: 40px;
        padding: 0;
        border-radius: 50%;
    }

    .chat-sidebar {
        width: 85%;
    }

    .input-inner {
        height: 60px;
    }
}

/* --- IPHONES PEQUEÑOS (375px) --- */
@media (max-width: 375px) {
    .hero-content {
        padding: 3vh 5vw 4vh;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .hero-social-link {
        width: 34px;
        height: 34px;
    }
}