/* ==========================================================================
   RESET & BASE
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #185778;
    --secondary-color: #1e293b;
    --accent-color: #0a8fc8;
    --text-color: #334155;
    --light-color: #f8fafc;
    --dark-color: #0f172a;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #ffffff;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Tipografía */
h1, h2, h3, h4 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.5rem; }

.highlight { color: #0a8fc8; }

.hero-tagline {
    font-size: 1.2rem;
    color: #878787;
    margin-top: 10px;
    font-weight: 400;
    letter-spacing: 1px;
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
    font-family: 'Poppins', sans-serif;
}

.btn i { font-size: 1.1rem; }

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #0874a5;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #334155;
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-nav { padding: 8px 20px; font-size: 0.9rem; }
.btn-large { padding: 16px 32px; font-size: 1.1rem; }

.btn-portal {
    background-color: #185778 !important;
    color: #ffffff !important;
    border: 1px solid #ffffff !important;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.btn-portal:hover {
    background-color: #ffffff !important;
    color: #185778 !important;
    border-color: #185778 !important;
    transform: translateY(-2px);
}

/* Navegación */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark-color);
    text-decoration: none;
}

.logo span { color: var(--primary-color); }

.nav-logo-img {
    height: 38px;
    width: auto;
    object-fit: contain;
    display: block;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.4s ease;
    pointer-events: none;
}

.navbar.scrolled .nav-logo-img {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-menu a:hover { color: var(--primary-color); }

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-menu a:hover::after { width: 100%; }

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark-color);
    cursor: pointer;
}

/* Hero */
.hero {
    padding-top: 100px !important;
    padding-bottom: 80px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f7ff 100%);
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title { margin-bottom: 1rem; }

.hero-title-logo {
    margin-top: 15px;
    margin-bottom: 20px;
    margin-left: -8px;
    text-align: left;
}

.hero-logo-img {
    max-width: 310px;
    width: 100%;
    height: auto;
    display: block;
}

.hero-subtitle {
    font-size: 1.8rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.hero-description {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: var(--text-color);
    max-width: 90%;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
}

.hero-stats {
    display: flex;
    gap: 2.5rem;
}

.stat { text-align: center; }

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
}

.hero-image { position: relative; }

.image-wrapper {
    position: relative;
    width: 400px;
    height: 400px;
    margin: 0 auto;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.image-badge {
    position: absolute;
    top: 20px;
    right: -20px;
    background: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    box-shadow: var(--shadow);
}

/* Secciones generales */
.section { padding: 80px 0; }
.section-title { text-align: center; margin-bottom: 3rem; }
.section-subtitle { color: var(--text-color); opacity: 0.8; font-size: 1.1rem; }

.section-subtitle-left {
    text-align: left;
    margin-bottom: 20px;
    max-width: 100%;
}

/* Sobre mí */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.about-text p { margin-bottom: 1.5rem; font-size: 1.1rem; }
.skills { margin-top: 2rem; }
.skills h3 { margin-bottom: 1rem; }

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 1rem;
}

.skill-tag {
    background-color: #e0f7ff;
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(10, 143, 200, 0.2);
}

.info-card {
    background: var(--light-color);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(10, 143, 200, 0.1);
}

.info-card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.info-list { list-style: none; margin-bottom: 2rem; }

.info-list li {
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.info-list strong { color: var(--dark-color); }

/* Servicios */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 40px;  /* ← agregado para igualar el diseño original */
}

.service-card {
    background: var(--light-color);
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
    transition: var(--transition);
    border: 1px solid transparent;
}

.service-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.service-icon { font-size: 3rem; color: var(--primary-color); margin-bottom: 1.5rem; }
.service-card h3 { margin-bottom: 1rem; }

.service-subtitle {
    text-align: center;
    color: #6c757d;
    font-family: 'Inter', sans-serif;
    margin-bottom: 20px;
    font-weight: 400;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* Portafolio */
.portfolio-header { text-align: center; margin-bottom: 3rem; }

.portfolio-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    background: var(--light-color);
    padding: 3rem;
    border-radius: var(--radius);
    border: 1px solid rgba(10, 143, 200, 0.1);
}

.portfolio-card { text-align: center; padding: 2rem; }
.portfolio-icon { font-size: 4rem; color: var(--primary-color); margin-bottom: 1.5rem; }

.portfolio-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
}

.portfolio-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--success-color);
    font-weight: 500;
}

.highlight-list { list-style: none; margin: 2rem 0; }

.highlight-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 10px;
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.highlight-list i { color: var(--success-color); }

.testimonial {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-top: 2rem;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.testimonial p { font-style: italic; margin-bottom: 0.5rem; }
.testimonial span { font-weight: 500; color: var(--primary-color); }

/* CTA */
.cta {
    background: linear-gradient(135deg, #0a8fc8 0%, #0874a5 100%);
    color: white;
    text-align: center;
}

.cta h2 { color: white; margin-bottom: 1rem; }
.cta p { opacity: 0.9; margin-bottom: 2rem; font-size: 1.1rem; }

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.cta .btn-outline {
    background-color: transparent;
    color: white;
    border-color: white;
}

.cta .btn-outline:hover {
    background-color: white;
    color: var(--primary-color);
}

/* Contacto */
.contact-header { text-align: center; margin-bottom: 40px; }
.contact-header h2 { margin-bottom: 10px; }

.contact-subtitle {
    font-size: 1.2rem;
    color: #666;
    font-weight: 400;
    margin-top: 5px;
    line-height: 1.4;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
}

.contact-info { display: grid; gap: 1.5rem; }

.contact-card {
    background: var(--light-color);
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid rgba(10, 143, 200, 0.1);
}

.contact-icon { font-size: 2rem; color: var(--primary-color); margin-bottom: 1rem; }

.contact-form { display: grid; gap: 1.5rem; }

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(10, 143, 200, 0.1);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: #c0c1c5 !important;
    opacity: 0.9 !important;
    font-weight: 300;
}

.form-select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    font-family: inherit;
    font-size: 1rem;
    color: #333;
    cursor: pointer;
    transition: border-color 0.3s;
}

.form-select:hover { border-color: #AF1821; }
.form-select:focus {
    outline: none;
    border-color: #AF1821;
    box-shadow: 0 0 0 2px rgba(175, 24, 33, 0.1);
}

optgroup { font-weight: 600; color: #AF1821; }
option { font-weight: normal; color: #333; }

.contact-workana-wrapper { margin-top: 15px; }   /* ← nueva clase */

.contact-workana-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.95rem;
}

/* Footer */
.footer {
    background-color: var(--dark-color);
    color: white;
    padding: 4rem 0 2rem;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
    margin-bottom: 3rem;
}

.footer-brand { flex: 1 1 250px; }

.footer .logo { color: white !important; font-size: 2rem; }
.footer .logo span { color: #4fc3f7 !important; }

.footer-brand p {
    opacity: 0.9;
    color: #e2e8f0;
    margin-top: 1rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.footer-qr { margin-top: 20px; text-align: left; }

.qr-image {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    border: 2px solid rgba(175, 24, 33, 0.3);
    transition: transform 0.3s ease, border-color 0.3s ease;
    object-fit: cover;
}

.qr-image:hover {
    transform: scale(1.05);
    border-color: var(--rojo-principal, #AF1821);
}

.qr-label {
    font-size: 11px;
    color: #878787;
    margin-top: 8px;
    font-weight: 400;
    letter-spacing: 0.3px;
}

.footer-links { flex: 1 1 200px; }

.footer-links h3 { color: white; margin-bottom: 1.5rem; font-size: 1.2rem; }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 0.8rem; }

.footer-links a {
    color: #e2e8f0 !important;
    text-decoration: none;
    transition: var(--transition);
    display: inline-block;
}

.footer-links a:hover { color: white !important; padding-left: 5px; }

.footer-cta { flex: 1 1 200px; }
.footer-cta h3 { color: white; margin-bottom: 1.5rem; font-size: 1.2rem; }

.footer .btn-outline {
    border-color: white;
    color: white;
    margin-bottom: 15px;  /* ← ajustado exactamente al diseño original */
}

.footer .btn-outline:hover { background-color: white; color: #0a8fc8; }

.social-links { display: flex; gap: 1rem; margin-top: 1.5rem; }

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white !important;
    border-radius: 50%;
    text-decoration: none;
    transition: var(--transition);
}

.social-links a i { color: white !important; }
.social-links a:hover i { color: #0a8fc8 !important; }

.footer-bottom {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    color: #cbd5e1;
    font-size: 0.9rem;
    opacity: 0.9;
}

.footer-bottom a { color: #4fc3f7; text-decoration: none; font-weight: 500; margin: 0 5px; }
.footer-bottom a:hover { color: white; text-decoration: underline; }
.footer-bottom p { margin-bottom: 0.5rem; }

/* Tech ticker */
.tech-ticker-container {
    width: 100%;
    max-width: 100vw;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    padding: 15px 0;
    margin: 20px 0;
}

.tech-ticker-mask {
    position: relative;
    overflow: hidden;
    padding: 0 !important;
}

.tech-ticker-mask::before,
.tech-ticker-mask::after {
    background: linear-gradient(to right, rgba(248,249,250,1) 0%, rgba(248,249,250,0) 100%);
    content: "";
    height: 100%;
    position: absolute;
    width: 80px;
    z-index: 2;
    pointer-events: none;
}

.tech-ticker-mask::before { left: 0; top: 0; }
.tech-ticker-mask::after { right: 0; top: 0; transform: rotate(180deg); }

.tech-ticker-track {
    display: flex;
    width: max-content;
    animation: scrollTicker 35s linear infinite;
}

.tech-ticker-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 200px;
    height: 80px;
    padding: 0 15px;
    flex-shrink: 0;
}

.tech-ticker-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: grayscale(100%) opacity(70%);
    transition: all 0.3s ease;
}

.tech-ticker-slide img:hover { filter: grayscale(0%) opacity(100%); }
.tech-ticker-container:hover .tech-ticker-track { animation-play-state: paused; }

@keyframes scrollTicker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-30%); }
}

/* Botón volver arriba */
#scrollTopBtn {
    position: fixed;
    bottom: 80px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #185778;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 9999;
    border: 2px solid white;
}

/* Mensaje de éxito */
.mensaje-exito {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #AF1821;
    border-radius: 15px;
    padding: 35px 25px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(175, 24, 33, 0.1);
    animation: aparecer 0.5s ease-out;
}

@keyframes aparecer {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.exito-icono {
    font-size: 4rem;
    color: #28a745;
    margin-bottom: 20px;
    animation: latir 1s ease-in-out;
}

@keyframes latir {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.1); }
}

.mensaje-exito h3 {
    color: #AF1821;
    font-size: 1.8rem;
    margin-bottom: 20px;
    font-weight: 600;
    border-bottom: 2px solid #AF1821;
    padding-bottom: 15px;
    display: inline-block;
}

.exito-contenido { max-width: 500px; margin: 0 auto; }

.exito-contenido p {
    color: #333;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.exito-destacado {
    font-size: 1.2rem;
    font-weight: 600;
    color: #AF1821;
    background: rgba(175, 24, 33, 0.05);
    padding: 12px;
    border-radius: 8px;
    margin: 20px 0;
}

.exito-firma {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px dashed #AF1821;
    font-style: italic;
    background: transparent !important;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #c3e6cb;
}

.alert-success h4 { margin-bottom: 15px; color: #155724; font-size: 1.5rem; }

/* Responsive */
@media (max-width: 992px) {
    h1 { font-size: 2.8rem; }
    h2 { font-size: 2.2rem; }
    .hero-content, .about-content, .portfolio-content, .contact-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    .image-wrapper { width: 300px; height: 300px; }
    .footer-content {
        flex-direction: column !important;
        text-align: center !important;
        align-items: center !important;
    }
}

@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .navbar .container { flex-wrap: wrap; }
    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: white;
        flex-direction: column;
        padding: 2rem;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
        gap: 15px;
        display: none;
    }
    .nav-menu.active { display: flex; transform: translateY(0); opacity: 1; visibility: visible; }
    .hero { padding: 120px 0 60px; }
    .hero-content, .about-content, .portfolio-content, .contact-content { flex-direction: column; }
    .hero-text { text-align: center; }
    .hero-buttons, .hero-stats, .social-links { justify-content: center; flex-wrap: wrap; }
    .hero-stats { flex-direction: column; gap: 1.5rem; }
    .services-grid, .contact-info { grid-template-columns: 1fr !important; }
    .portfolio-content { padding: 2rem; }
    .cta-buttons { flex-direction: column; }
    .footer-content {
        flex-direction: column !important;
        text-align: center !important;
        align-items: center !important;
    }
    .footer-qr .qr-image { margin: 0 auto; }
    .qr-image { width: 80px; height: 80px; }
    .footer-qr { text-align: center; }
    #scrollTopBtn { bottom: 70px; right: 20px; width: 45px; height: 45px; }
    .hero-title-logo { text-align: center !important; }
    .hero-logo-img { max-width: 260px !important; margin: 0 auto !important; }
    .contact-subtitle { font-size: 1rem; padding: 0 15px; }
    .btn-portal { margin-right: 0 !important; margin-bottom: 10px !important; display: block !important; text-align: center; }
    .mensaje-exito { padding: 25px 15px; }
    .mensaje-exito h3 { font-size: 1.5rem; }
    .exito-contenido p { font-size: 1rem; }
}

@media (max-width: 600px) {
    .tech-ticker-container { margin: 25px 0; }
    .tech-ticker-container::before,
    .tech-ticker-container::after { width: 50px; }
    .tech-ticker-slide { width: 140px; height: 60px; padding: 0 10px; }
    .tech-ticker-track { animation-duration: 22s; }
}

@media (max-width: 480px) {
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    .section { padding: 60px 0; }
    .image-wrapper { width: 250px; height: 250px; }
    .image-badge {
        position: relative;
        top: 0;
        right: 0;
        margin-top: 1rem;
        justify-content: center;
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
    }
    .hero-stats { flex-direction: row; flex-wrap: wrap; justify-content: center; }
    .stat { min-width: 100px; }
    .portfolio-content { padding: 1.5rem; }
    .footer { padding: 3rem 0 1.5rem; }
    .hero-buttons .btn, .cta-buttons .btn { width: 100%; text-align: center; justify-content: center; }
    .cta-buttons { flex-direction: column; align-items: center; }
    .cta-buttons .btn { max-width: 280px; }
    #scrollTopBtn { bottom: 60px; right: 15px; width: 40px; height: 40px; font-size: 0.9rem; }
}

/* Animaciones y accesibilidad */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

.service-card, .portfolio-card, .contact-card { animation: fadeInUp 0.6s ease-out; }

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

a[download]::after {
    content: '⬇';
    margin-left: 5px;
    font-size: 0.9em;
}