/* FUENTES LOCALES */
        @font-face {
            font-family: 'GoogleSans';
            src: url('GoogleSans-Regular.ttf') format('truetype');
            font-weight: normal;
            font-style: normal;
        }

        @font-face {
            font-family: 'GoogleSans';
            src: url('GoogleSans-Bold.ttf') format('truetype');
            font-weight: bold;
            font-style: normal;
        }

        @import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;700&display=swap');

        /* RESET BÁSICO Y QUITAR RESALTO AZUL TÁCTIL EN MÓVILES */
        * { 
            margin: 0; 
            padding: 0; 
            box-sizing: border-box; 
        }

        a, button {
            -webkit-tap-highlight-color: transparent;
        }

        :root {
            --bg-dark: #050505;       
            --bg-card: #0f0f0f;       
            --bg-surface: #111111;
            --bg-hover: #1a1a1a;
            --bg-active: #151515;
            --border: #222222;
            --border-mid: #333333;
            --border-hover: #444444;
            --text-main: #f0f0f0;     
            --text-muted: #999;       
            --text-body: #cccccc;
            --accent: #ff0033;
            --accent-rgb: 255, 0, 51;
            --accent-dim: rgba(255, 0, 51, 0.1);
            --tree-line: #333;
        }

        body.light {
            --bg-dark: #f0f0f0;
            --bg-card: #ffffff;
            --bg-surface: #e8e8e8;
            --bg-hover: #dedede;
            --bg-active: #f5f5f5;
            --border: #d0d0d0;
            --border-mid: #cccccc;
            --border-hover: #aaaaaa;
            --text-main: #111111;
            --text-muted: #555555;
            --text-body: #444444;
            --accent-dim: rgba(255, 0, 51, 0.08);
            --tree-line: #cccccc;
        }

        /* OCULTAR BARRA DE SCROLL GLOBAL Y EFECTO DIAPOSITIVAS */
        html {
            scroll-behavior: smooth;
            scrollbar-width: none;
            -ms-overflow-style: none;
        }

        html::-webkit-scrollbar {
            display: none; 
        }

        body {
            background-color: var(--bg-dark);
            color: var(--text-main);
            font-family: 'GoogleSans', sans-serif;
            line-height: 1.6;
            margin: 0;
            scrollbar-width: none;
            height: auto !important;
            display: block !important;
            overflow-x: hidden !important;
        }

        body::-webkit-scrollbar { display: none; }

        /* SISTEMA MULTI-IDIOMA */
        body.es .en { display: none !important; }
        body.en .es { display: none !important; }

        /* FUENTES TIPO CÓDIGO */
        .mono, .tech-tag, .btn, code, .repo-tree-container, .cert-badge, .cert-issuer { 
            font-family: 'Fira Code', monospace; 
        }

        h1, h2, h3 { 
            font-family: 'GoogleSans', sans-serif; 
            font-weight: bold;
        }

        /* NAVEGACIÓN */
        nav {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px 5%; 
            position: fixed;
            width: 100%;
            top: 0;
            background: color-mix(in srgb, var(--bg-dark) 95%, transparent);
            backdrop-filter: blur(5px);
            border-bottom: 1px solid var(--border);
            z-index: 1000;
            transition: background 0.3s, border-color 0.3s;
        }

        .nav-left {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .logo { 
            font-size: 1.5rem; 
            font-weight: bold; 
            color: var(--text-main); 
            letter-spacing: -0.5px; 
            font-family: 'Fira Code', monospace; 
        }

        .logo span {
            color: var(--accent);
        }

        /* PILLS DE IDIOMA Y TEMA — estilo Vercel/Apple */
        .lang-switch {
            cursor: pointer;
            color: var(--text-muted);
            font-size: 0.8rem;
            display: flex;
            align-items: center;
            gap: 7px;
            font-family: 'Fira Code', monospace;
            border: 1px solid var(--border-mid);
            padding: 6px 14px 6px 11px;
            border-radius: 999px;
            transition: color 0.22s ease, border-color 0.22s ease, background 0.22s ease, transform 0.18s ease, box-shadow 0.22s ease;
            background: rgba(255,255,255,0.03);
            letter-spacing: 0.02em;
        }

        .lang-switch i {
            font-size: 1.1rem;
            transition: transform 0.3s ease;
        }

        .lang-switch:hover {
            color: var(--accent);
            border-color: rgba(var(--accent-rgb), 0.6);
            background: rgba(var(--accent-rgb), 0.07);
            box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.12);
            transform: scale(1.04);
        }

        .lang-switch:hover i {
            transform: rotate(12deg);
        }

        .lang-switch.pulse {
            animation: slowPulse 2s ease-out;
        }
        @keyframes slowPulse {
            0%, 15% { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
            100%     { border-color: var(--border-mid); color: var(--text-muted); background: rgba(255,255,255,0.03); }
        }

        /* MENÚ ORDENADOR */
        .desktop-nav { 
            list-style: none; 
            display: flex; 
            align-items: center;
            gap: 25px; 
            margin: 0;
            padding: 0;
        }
        .desktop-nav a { 
            text-decoration: none; 
            color: var(--text-muted); 
            font-size: 0.95rem; 
            transition: 0.3s; 
            font-family: 'Fira Code', monospace; 
        }
        .desktop-nav a:hover { color: var(--accent); }
        .desktop-nav a.nav-active { color: var(--accent); }

        /* MENÚ MÓVIL (OCULTO EN PC) */
        .mobile-menu-wrapper {
            display: none;
            position: relative;
        }

        .mobile-menu-btn {
            background: transparent;
            border: 1px solid var(--border-mid);
            color: var(--text-muted);
            padding: 5px 12px;
            border-radius: 4px;
            font-size: 1.2rem;
            cursor: pointer;
            transition: 0.3s;
        }

        .mobile-menu-btn:hover {
            color: var(--text-main);
            border-color: var(--border-hover);
        }

        .mobile-menu-btn.pulse {
            animation: quickPulse 0.8s ease-out;
        }
        @keyframes quickPulse {
            0%, 10% { border-color: var(--accent); color: var(--accent); }
            100% { border-color: var(--border-mid); color: var(--text-muted); }
        }

        .mobile-menu-dropdown {
            display: none;
            position: absolute;
            right: 0;
            top: 48px;
            background: var(--bg-card);
            border: 1px solid var(--accent);
            border-radius: 6px;
            flex-direction: column;
            width: 175px;
            box-shadow: 0 8px 24px rgba(0,0,0,0.85);
            z-index: 2000;
            overflow: hidden;
        }

        .mobile-menu-dropdown.active {
            display: flex;
        }

        .mobile-menu-dropdown a {
            padding: 12px 16px;
            color: var(--text-main);
            text-decoration: none;
            border-bottom: 1px solid var(--border);
            font-family: 'Fira Code', monospace;
            font-size: 0.88rem;
            transition: color 0.2s, background 0.2s;
        }

        .mobile-menu-dropdown a:last-child {
            border-bottom: none;
        }

        .mobile-menu-dropdown a:hover {
            color: var(--accent);
            background: var(--bg-surface);
        }

        /* CV button dentro del dropdown: separado visualmente */
        .mobile-menu-dropdown .btn-cv-nav {
            margin: 6px 12px 10px;
            padding: 8px 14px;
            border-radius: 4px;
            justify-content: center;
            border-bottom: none;
            font-size: 0.85rem;
        }

        /* SPA — visibilidad de secciones */
        .section-hidden {
            display: none !important;
        }

        .section-active {
            display: flex !important;
            animation: sectionFadeIn 0.45s ease;
            overflow-y: auto;
            min-height: 100dvh;
            max-height: 100dvh;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: none !important;
            -ms-overflow-style: none !important;
        }

        .section-active::-webkit-scrollbar { display: none !important; }

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

        /* SECCIONES — scroll libre, sin snap */
        section {
            min-height: 100vh;
            min-height: 100dvh;
            width: 100%;
            padding-bottom: 20px !important;
            display: flex;
            flex-direction: column;
            position: relative;
            overflow: visible;
        }

        /* INICIO */
        #inicio {
            justify-content: flex-start !important;
            align-items: flex-start !important;
            padding-top: 120px !important;
            padding-bottom: 60px;
            background: radial-gradient(circle at 50% 40%, rgba(255, 0, 51, 0.13) 0%, var(--bg-dark) 65%);
        }

        /* SECCIONES DE CONTENIDO */
        #servicios, #proyectos, #certificaciones {
            justify-content: flex-start;
            padding-top: 100px;
            padding-bottom: 60px;
        }

        /* Servicios puede ser más alta que 100vh */
        #servicios {
            min-height: auto;
        }

        /* HERO SECTION */
        .hero-container {
            display: flex;
            flex-direction: row; 
            align-items: center;
            justify-content: center;
            gap: 50px; 
            width: 100%;
            max-width: 1050px;
            margin: 0 auto;
            text-align: left; 
            padding: 0 40px;
        }

        .hero-image {
            display: flex;
            justify-content: center;
            align-items: center;
            flex-shrink: 0;
        }

        .profile-pic {
            width: 250px;
            height: 250px; 
            object-fit: cover; 
            border-radius: 50%; 
            border: 4px solid var(--accent);
            box-shadow: 0 0 30px rgba(255, 0, 51, 0.2);
            transition: box-shadow 0.4s ease, transform 0.4s ease;
            cursor: default;
        }
        .profile-pic[src=""], .profile-pic:not([src]) { opacity: 0; }
        .profile-pic:hover {
            box-shadow: 0 0 40px rgba(255, 0, 51, 0.35), 0 0 70px rgba(255, 0, 51, 0.08);
            transform: scale(1.03);
        }


        .hero-content {
            display: flex;
            flex-direction: column;
            align-items: flex-start; 
        }

        .hero h1 { 
            font-size: 3rem; 
            line-height: 1.1; 
            margin-bottom: 10px; 
            color: var(--accent); 
        }

        .hero h2 { 
            font-size: 1.2rem; 
            color: var(--text-main); 
            margin-bottom: 20px; 
            font-weight: normal; 
        }

        .hero p { 
            font-size: 0.95rem; 
            color: var(--text-muted); 
            margin: 0 0 25px 0; 
            line-height: 1.6;
        }

        .tech-tags {
            display: flex;
            gap: 12px;
            margin-bottom: 0.5rem !important;
            flex-wrap: wrap;
            justify-content: flex-start;
        }

        .tech-tag {
            display: flex; align-items: center; gap: 8px;
            border: 1px solid var(--border-mid); padding: 8px 20px !important; border-radius: 9999px !important;
            font-size: 0.85rem;
            color: var(--text-main); background: rgba(255, 255, 255, 0.03);
        }
        .tech-tag i { color: var(--accent); }

        .social-icons {
            font-size: 1.8rem;
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            justify-content: flex-start;
            gap: 35px;
            margin-top: 1rem !important;
        }
        .social-icons a { color: var(--text-muted); transition: 0.3s; }
        .social-icons a:hover { color: var(--accent); transform: translateY(-3px); }

        /* BOTÓN CV — NAV (desktop only) */
        .btn-cv-nav {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            color: var(--accent) !important;
            font-weight: bold;
            font-family: 'Fira Code', monospace;
            font-size: 0.88rem;
            text-decoration: none;
            border: 1px solid rgba(var(--accent-rgb), 0.5);
            background: rgba(var(--accent-rgb), 0.08);
            padding: 5px 18px;
            border-radius: 999px;
            letter-spacing: 0.06em;
            transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
        }

        .btn-cv-nav:hover {
            background: rgba(var(--accent-rgb), 0.16);
            border-color: rgba(var(--accent-rgb), 0.85);
            box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.22);
            transform: translateY(-1px);
        }

        .btn-cv-hero {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            color: var(--accent) !important;
            font-size: 1.1rem;
            font-family: 'Fira Code', monospace;
            font-weight: bold;
            text-decoration: none;
        }

        /* ESTILOS COMPARTIDOS DESPLEGABLES */
        .section-title {
            display: none !important;
        }

        .repo-tree-container { 
            max-width: 900px; 
            margin: 0 auto; 
            width: 100%; 
            padding: 0 5% 80px 5%; 
        }

        .root-node {
            font-size: 1.3rem; font-weight: bold; color: var(--text-main);
            margin-bottom: 18px; display: flex; align-items: center; gap: 10px;
            padding: 14px 18px;
            background: var(--bg-surface);
            border: 1px solid var(--border);
            border-radius: 6px;
            font-family: 'Fira Code', monospace;
        }
        .root-node a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; transition: 0.3s; }
        .root-node a:hover { border-color: var(--accent); filter: brightness(1.2); }

        .tree-children {
            margin-left: 20px; border-left: 2px solid var(--tree-line); padding-left: 20px;
            display: flex; flex-direction: column; gap: 10px;
        }

        .tree-item { position: relative; }
        .tree-item::before {
            content: ""; position: absolute; top: 15px; left: -22px; width: 20px; height: 2px; background: var(--tree-line);
        }

        .tree-trigger {
            background: var(--bg-surface); border: 1px solid var(--border); padding: 15px 20px; cursor: pointer;
            color: var(--text-muted); font-size: 1rem; display: flex; align-items: center;
            gap: 10px; transition: all 0.3s ease; width: 100%; font-family: 'Fira Code', monospace;
            border-radius: 6px;
        }
        .tree-trigger:hover {
            color: var(--text-main); border-color: var(--border-hover); background: var(--bg-hover);
            box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.06);
        }
        .tree-trigger i { font-size: 0.9rem; }
        .tree-trigger .arrow { margin-left: auto; transition: 0.3s; }

        .tree-item.active > .tree-trigger {
            border-color: var(--accent); color: var(--text-main); background: var(--bg-active);
            border-radius: 6px 6px 0 0;
            box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.15);
        }
        .tree-item.active > .tree-trigger .arrow { transform: rotate(90deg); color: var(--accent); }

        .tree-content {
            max-height: 0; overflow: hidden; background: var(--bg-card);
            border-left: 1px solid var(--border); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
            margin-top: -1px; transition: max-height 0.4s ease-out;
            border-radius: 0 0 6px 6px;
        }
        .tree-item.active > .tree-content {
            max-height: 2500px; border-color: var(--accent);
            transition: max-height 0.5s ease-in;
            box-shadow: 0 4px 20px rgba(var(--accent-rgb), 0.07);
        }

        .content-padding { padding: 20px; }
        .content-padding h4 { font-size: 1.1rem; margin-bottom: 10px; font-family: 'Fira Code', monospace; }
        .content-padding h4 a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; transition: 0.3s; }
        .content-padding h4 a:hover { border-bottom: 1px solid var(--accent); filter: brightness(1.2); }
        .content-padding p { color: var(--text-body); margin-bottom: 15px; font-size: 0.95rem; }

        .cert-list { list-style: none; padding: 0; margin: 0; }
        .cert-list li {
            padding: 12px 14px;
            border-bottom: 1px solid var(--border);
            display: flex; align-items: center; gap: 15px;
            border-radius: 6px;
            transition: background 0.2s ease, border-color 0.2s ease;
        }
        .cert-list li:hover {
            background: var(--bg-hover);
            border-color: rgba(var(--accent-rgb), 0.25);
        }
        .cert-list li:last-child { border-bottom: none; padding-bottom: 12px; }
        .cert-list i { color: var(--accent); font-size: 1.4rem; min-width: 30px; text-align: center; }
        .cert-title-text { display: block; color: var(--text-main); font-weight: bold; font-size: 0.95rem; margin-bottom: 2px; }
        .cert-issuer-text { display: block; color: var(--text-muted); font-size: 0.8rem; font-family: 'Fira Code', monospace; }

        /* ESTILO DEL BOTÓN EXTERNO DE FACTUGEN */
        .btn-external {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            padding: 12px 24px;
            background: var(--bg-surface);
            border: 1px solid var(--accent);
            color: var(--text-main);
            text-decoration: none;
            border-radius: 4px;
            font-family: 'Fira Code', monospace;
            font-size: 0.95rem;
            transition: all 0.3s ease;
        }
        .btn-external:hover {
            background: var(--accent-dim);
            color: var(--text-main);
            transform: translateY(-2px);
        }

        /* JUEGO SNAKE ADAPTADO */
        #game-wrapper {
            width: 100%; display: flex; justify-content: center; background: #000;
            border: 1px solid var(--border-mid); margin-top: 15px; padding: 10px;
        }
        canvas#snakeCanvas { 
            background-color: #000; 
            max-width: 100%; 
            max-height: 40vh; 
            width: auto;
            height: auto;
            touch-action: none; 
            cursor: pointer; 
        }

        /* Footer local — dentro de cada sección */
        .footer-local {
            display: block !important;
            text-align: center !important;
            width: 100% !important;
            margin-top: 60px !important;
            padding-bottom: 120px !important;
            clear: both !important;
        }
        .footer-local a {
            color: rgba(255, 255, 255, 0.4);
            text-decoration: none;
            font-size: 14px;
            transition: color 0.2s;
        }
        .footer-local a:hover { color: var(--accent); }
        body.light .footer-local a { color: #555 !important; font-weight: 500 !important; }
        body.light .footer-local a:hover { color: var(--accent) !important; }

        /* EFECTO FADE-IN PURO (DESVANECIMIENTO SUAVE) */
        .fade-in {
            opacity: 0;
            transition: opacity 1s ease-in-out;
        }
        .fade-in.visible {
            opacity: 1;
        }

        /* MÓVIL (MEDIA QUERY) */
        @media (max-width: 900px) {
            .desktop-nav { display: none; }
            .mobile-menu-wrapper {
                display: flex;
                align-items: center;
            }

            #inicio {
                justify-content: flex-start;
                padding-top: 90px;
                padding-bottom: 40px;
            }

            .hero-container {
                flex-direction: column;
                text-align: center;
                gap: 20px;
            }
            .hero-content { align-items: center; }
            .hero p { text-align: center; }
            .tech-tags { justify-content: center; }
            .social-icons {
                justify-content: center;
                padding-bottom: 20px;
                flex-wrap: wrap;
            }

            .hero h1 { font-size: 2.5rem; }
            .profile-pic { width: 180px; height: 180px; margin-bottom: 0; }

            #servicios, #proyectos, #certificaciones { padding-top: 85px; }
            .content-padding { padding: 15px; }

            .tree-children {
                margin-left: 10px;
                padding-left: 12px;
            }

            .repo-tree-container {
                padding: 0 2% 80px 2%;
            }

            canvas#snakeCanvas {
                max-height: 50vh;
                width: 100%;
            }

            /* CV dentro del menú móvil */
            .mobile-menu-dropdown .btn-cv-mobile {
                margin: 4px 12px 10px;
                border-radius: 4px;
                justify-content: center;
                font-size: 0.85rem;
            }
        }


        /* section dots eliminados */



        /* TYPEWRITER CURSOR */
        #tw-es::after, #tw-en::after {
            content: '|';
            color: var(--accent);
            animation: blink 0.8s step-end infinite;
        }
        @keyframes blink {
            0%, 100% { opacity: 1; }
            50%       { opacity: 0; }
        }

        /* MODO CLARO */

        /* BOTÓN FLOTANTE CONTACTO */
        #fab-contact {
            position: fixed;
            bottom: 30px;
            left: 24px;
            border-radius: 9999px;
            padding: 12px 24px;
            width: auto;
            height: auto;
            background: var(--bg-card);
            border: 2px solid var(--accent);
            color: var(--accent);
            font-size: 0.85rem;
            font-family: 'Fira Code', monospace;
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            z-index: 8000;
            transition: background 0.3s, transform 0.3s, box-shadow 0.3s;
            box-shadow: 0 0 12px rgba(255, 0, 51, 0.2);
            text-decoration: none;
        }
        #fab-contact:hover {
            background: var(--accent-dim);
            transform: scale(1.1);
            box-shadow: 0 0 20px rgba(255, 0, 51, 0.4);
        }
        @media (max-width: 768px) {
            #fab-contact {
                bottom: 24px;
                left: 20px;
                padding: 10px 18px;
                font-size: 0.8rem;
            }
        }



        /* ============================================
           VIEW TRANSITION — THEME TOGGLE (máscara SVG)
           Exactamente como theme-toggle.rdsx.dev
           ============================================ */
        ::view-transition-new(root) {
            mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><circle cx="20" cy="20" r="20" fill="white"/></svg>') center / 0 no-repeat;
            animation: vt-mask-scale 1s ease;
            animation-fill-mode: both;
        }

        ::view-transition-old(root),
        .dark::view-transition-old(root) {
            animation: none;
            animation-fill-mode: both;
            z-index: -1;
        }

        .dark::view-transition-new(root) {
            animation: vt-mask-scale 1s ease;
            animation-fill-mode: both;
        }

        @keyframes vt-mask-scale {
            to { mask-size: 200vmax; }
        }

/* LÍNEA DE SCAN AL ENTRAR EN SECCIÓN */
        section::after {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 2px;
            background: linear-gradient(90deg, transparent, var(--accent), transparent);
            opacity: 0;
            pointer-events: none;
            z-index: 500;
        }
        section.section-visible::after {
            animation: scanline 0.6s ease-out forwards;
        }
        @keyframes scanline {
            0%   { opacity: 0.8; top: 60px; }
            100% { opacity: 0;   top: 100vh; }
        }
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cg stroke='%23ffffff' stroke-width='0.8' fill='none' opacity='0.06'%3E%3Cpath d='M10 40 L60 40 L60 10 L120 10'/%3E%3Cpath d='M120 10 L120 70 L180 70'/%3E%3Cpath d='M180 70 L240 70 L240 40 L290 40'/%3E%3Cpath d='M10 120 L50 120 L50 160 L110 160'/%3E%3Cpath d='M110 160 L110 200 L170 200 L170 160 L230 160 L230 120 L290 120'/%3E%3Cpath d='M10 220 L70 220 L70 260 L130 260 L130 290'/%3E%3Cpath d='M130 290 L190 290 L190 250 L250 250 L250 220 L290 220'/%3E%3Cpath d='M150 10 L150 50 L210 50 L210 10'/%3E%3Cpath d='M290 160 L270 160 L270 200 L210 200 L210 240 L290 240'/%3E%3Ccircle cx='60' cy='40' r='3'/%3E%3Ccircle cx='120' cy='10' r='3'/%3E%3Ccircle cx='120' cy='70' r='3'/%3E%3Ccircle cx='180' cy='70' r='3'/%3E%3Ccircle cx='240' cy='40' r='3'/%3E%3Ccircle cx='50' cy='120' r='3'/%3E%3Ccircle cx='110' cy='160' r='3'/%3E%3Ccircle cx='170' cy='200' r='3'/%3E%3Ccircle cx='230' cy='160' r='3'/%3E%3Ccircle cx='70' cy='220' r='3'/%3E%3Ccircle cx='130' cy='260' r='3'/%3E%3Ccircle cx='190' cy='290' r='3'/%3E%3Ccircle cx='250' cy='250' r='3'/%3E%3Ccircle cx='150' cy='50' r='3'/%3E%3Ccircle cx='210' cy='50' r='3'/%3E%3Ccircle cx='270' cy='200' r='3'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 300px 300px;
    background-repeat: repeat;
    pointer-events: none;
    z-index: 0;
}

body.light::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cg stroke='%23555555' stroke-width='0.8' fill='none' opacity='0.07'%3E%3Cpath d='M10 40 L60 40 L60 10 L120 10'/%3E%3Cpath d='M120 10 L120 70 L180 70'/%3E%3Cpath d='M180 70 L240 70 L240 40 L290 40'/%3E%3Cpath d='M10 120 L50 120 L50 160 L110 160'/%3E%3Cpath d='M110 160 L110 200 L170 200 L170 160 L230 160 L230 120 L290 120'/%3E%3Cpath d='M10 220 L70 220 L70 260 L130 260 L130 290'/%3E%3Cpath d='M130 290 L190 290 L190 250 L250 250 L250 220 L290 220'/%3E%3Cpath d='M150 10 L150 50 L210 50 L210 10'/%3E%3Cpath d='M290 160 L270 160 L270 200 L210 200 L210 240 L290 240'/%3E%3Ccircle cx='60' cy='40' r='3'/%3E%3Ccircle cx='120' cy='10' r='3'/%3E%3Ccircle cx='120' cy='70' r='3'/%3E%3Ccircle cx='180' cy='70' r='3'/%3E%3Ccircle cx='240' cy='40' r='3'/%3E%3Ccircle cx='50' cy='120' r='3'/%3E%3Ccircle cx='110' cy='160' r='3'/%3E%3Ccircle cx='170' cy='200' r='3'/%3E%3Ccircle cx='230' cy='160' r='3'/%3E%3Ccircle cx='70' cy='220' r='3'/%3E%3Ccircle cx='130' cy='260' r='3'/%3E%3Ccircle cx='190' cy='290' r='3'/%3E%3Ccircle cx='250' cy='250' r='3'/%3E%3Ccircle cx='150' cy='50' r='3'/%3E%3Ccircle cx='210' cy='50' r='3'/%3E%3Ccircle cx='270' cy='200' r='3'/%3E%3C/g%3E%3C/svg%3E");
}

#inicio {
    position: relative;
    z-index: 1;
    background: radial-gradient(circle at 50% 40%, rgba(255, 0, 51, 0.13) 0%, transparent 65%) !important;
}

/* ============================================
   SERVICIOS — estructura base
   (CSS complejo de mockups/lista/chat → Fase 3)
   ============================================ */

.servicios-container {
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
    padding: 0 5% 80px;
    display: flex;
    flex-direction: column;
    gap: 80px;
}

.servicio-bloque {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 60px;
    border-bottom: 1px solid var(--border);
}

.servicio-bloque:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.servicio-header {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
}

.servicio-num {
    display: none !important;
}

.servicio-bloque:hover .servicio-num {
    color: var(--accent) !important;
}

.servicio-titulo {
    font-size: 2.5rem;
    font-family: 'GoogleSans', sans-serif;
    font-weight: bold;
    color: var(--text-main);
    line-height: 1.1;
    text-align: center;
    white-space: nowrap !important;
}

.servicio-desc {
    font-size: 0.97rem;
    color: var(--text-body);
    line-height: 1.7;
    max-width: 680px;
}

@media (max-width: 900px) {
    .servicios-container {
        padding: 0 3% 60px;
        gap: 60px;
    }

    .servicio-num {
        font-size: 1.5rem;
    }

    .servicio-titulo {
        font-size: 1.8rem;
    }
}

/* ============================================================
   SERVICIOS FASE 3
   Lista proyectos · Mockups · Automatización · Chat · Scripts
   ============================================================ */

/* ─────────────────────────────────────────
   LISTA DE PROYECTOS  (estilo tten.dev)
   ───────────────────────────────────────── */
.proyectos-lista {
    display: flex;
    flex-direction: column;
    position: relative;
    margin-top: 36px;
    overflow: visible;
}

.proyecto-fila {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
    position: relative;
    cursor: pointer;
    transition: padding-left 0.2s ease, background 0.2s ease;
    overflow: visible;
}

.proyecto-fila:first-child {
    border-top: 1px solid var(--border);
}

.proyecto-fila:hover {
    padding-left: 10px;
    background: rgba(255,255,255,0.015);
}

a.proyecto-fila {
    text-decoration: none;
    color: inherit;
    display: flex;
}

.proy-nombre {
    font-family: 'GoogleSans', sans-serif;
    font-size: 1.35rem;
    font-weight: bold;
    color: var(--text-main);
    flex: 1;
    transition: color 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.proyecto-fila:hover .proy-nombre {
    color: var(--accent);
}

.proy-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.proy-sector {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-right: 4px;
}

.proy-tag {
    font-family: 'Fira Code', monospace;
    font-size: 0.65rem;
    color: var(--text-muted);
    border: 1px solid var(--border-mid);
    padding: 2px 8px;
    border-radius: 999px;
    transition: border-color 0.2s, color 0.2s;
}

.proyecto-fila:hover .proy-tag {
    border-color: rgba(255,0,51,0.4);
    color: var(--text-main);
}

.proy-flecha {
    font-size: 1rem;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.22s ease, color 0.2s;
}

.proyecto-fila:hover .proy-flecha {
    transform: translateX(5px);
    color: var(--accent);
}

/* Floating mockup preview */
.proy-preview {
    position: absolute;
    right: -298px;
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    width: 268px;
    height: 196px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 300;
    border-radius: 7px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.85), 0 0 0 1px var(--border-mid);
}

.proyecto-fila:hover .proy-preview {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Las últimas filas muestran el preview hacia arriba para no salirse de pantalla */
.proyecto-fila:nth-last-child(-n+2) .proy-preview {
    top: auto;
    bottom: 0;
    transform: translateY(0) translateX(6px);
}

.proyecto-fila:nth-last-child(-n+2):hover .proy-preview {
    transform: translateY(0) translateX(0);
}

@media (max-width: 1280px) {
    .proy-preview  { display: none; }
    .proy-meta     { display: none; }
}

@media (max-width: 768px) {
    .proy-num      { display: none; }
    .proy-nombre   { font-size: 1rem; }
}


/* ─────────────────────────────────────────
   MODALES PANTALLA COMPLETA
   ───────────────────────────────────────── */
.mockup-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    backdrop-filter: blur(6px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 24px 16px;
}

.modal-close {
    position: absolute;
    top: 18px;
    right: 22px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.55);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #fff;
}

.modal-inner {
    width: 90vw;
    max-width: 1200px;
    height: 90vh;
    max-height: 800px;
    border-radius: 16px !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden !important;
    box-shadow: 0 30px 90px rgba(0,0,0,0.9);
    position: relative;
}


/* ─────────────────────────────────────────
   MOCKUP: NOIR DINING
   Dark · Elegante · Restaurante
   ───────────────────────────────────────── */
.mock-noir {
    width: 100%; height: 100%;
    background: #080808;
    display: flex; flex-direction: column;
    overflow: hidden;
}

.mock-noir-nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 11px 18px;
    background: rgba(4,4,4,0.98);
    border-bottom: 1px solid rgba(200,169,110,0.18);
    flex-shrink: 0;
}

.mock-noir-nav > span {
    font-family: 'Georgia', serif;
    font-size: clamp(0.7rem, 1.8vw, 1rem);
    letter-spacing: 6px;
    color: #c8a96e;
    text-transform: uppercase;
}

.mock-noir-nav nav {
    font-family: 'Fira Code', monospace;
    font-size: clamp(0.5rem, 1.2vw, 0.62rem);
    color: rgba(255,255,255,0.35);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.mock-noir-hero {
    flex: 1;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    text-align: center; padding: 20px 16px;
    background:
        radial-gradient(ellipse at 50% 60%, rgba(200,169,110,0.07) 0%, transparent 65%),
        linear-gradient(180deg, #0e0905 0%, #080808 100%);
    border-bottom: 1px solid rgba(200,169,110,0.1);
}

.mock-noir-hero h2 {
    font-family: 'Georgia', serif;
    font-size: clamp(1rem, 3.5vw, 2.1rem);
    font-weight: normal; font-style: italic;
    color: #f0ede6; letter-spacing: 2px; line-height: 1.4;
    margin-bottom: 14px;
}

.mock-noir-hero button {
    font-family: 'Fira Code', monospace;
    font-size: clamp(0.5rem, 1.3vw, 0.65rem);
    letter-spacing: 3px; text-transform: uppercase;
    color: #c8a96e; background: transparent;
    border: 1px solid rgba(200,169,110,0.4);
    padding: 7px 18px; cursor: default;
    transition: border-color 0.3s, background 0.3s;
}

.mock-noir-items {
    display: flex; justify-content: center; flex-shrink: 0;
    padding: 9px 16px; background: #050505; gap: 0;
}

.mock-noir-items > div {
    flex: 1; text-align: center; padding: 7px 4px;
    font-family: 'Fira Code', monospace;
    font-size: clamp(0.48rem, 1.1vw, 0.62rem);
    color: rgba(200,169,110,0.55); letter-spacing: 1px; text-transform: uppercase;
    border-right: 1px solid rgba(200,169,110,0.08);
}

.mock-noir-items > div:last-child { border-right: none; }

.mock-noir-footer {
    padding: 5px; text-align: center;
    font-size: 0.5rem; font-family: 'Fira Code', monospace;
    color: rgba(255,255,255,0.12); background: #030303;
    letter-spacing: 1px; flex-shrink: 0;
}


/* ─────────────────────────────────────────
   MOCKUP: SALUD VITAL
   Blanco · Limpio · Clínica
   ───────────────────────────────────────── */
.mock-salud {
    width: 100%; height: 100%;
    background: #f8fbff;
    display: flex; flex-direction: column;
    overflow: hidden;
}

.mock-salud-nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 18px;
    background: #1565c0; flex-shrink: 0;
}

.mock-salud-nav > span {
    font-family: 'GoogleSans', sans-serif;
    font-weight: bold;
    font-size: clamp(0.7rem, 1.8vw, 0.92rem);
    color: #fff; letter-spacing: 0.5px;
}

.mock-salud-nav nav {
    font-size: clamp(0.5rem, 1.1vw, 0.62rem);
    color: rgba(255,255,255,0.7); letter-spacing: 0.5px;
}

.mock-salud-hero {
    flex: 1;
    display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
    padding: 20px 24px;
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f7ff 60%);
    border-bottom: 2px solid #d0e8f8;
}

.mock-salud-hero h2 {
    font-family: 'GoogleSans', sans-serif;
    font-size: clamp(0.9rem, 2.8vw, 1.8rem);
    font-weight: bold; color: #1a2a3a; line-height: 1.3;
    margin-bottom: 12px;
}

.mock-salud-hero button {
    font-family: 'GoogleSans', sans-serif;
    font-size: clamp(0.55rem, 1.2vw, 0.72rem);
    font-weight: bold;
    background: #1565c0; color: #fff;
    border: none; padding: 7px 16px;
    border-radius: 4px; cursor: default;
}

.mock-salud-cards {
    display: flex; flex-wrap: wrap;
    padding: 10px 14px; gap: 6px;
    background: #fff; flex-shrink: 0;
}

.mock-salud-cards > div {
    flex: 1; min-width: 70px;
    padding: 8px 6px; text-align: center;
    font-family: 'GoogleSans', sans-serif;
    font-size: clamp(0.52rem, 1.2vw, 0.65rem);
    font-weight: 600; color: #1565c0;
    background: #e8f4ff; border: 1px solid #c5dff5;
    border-radius: 4px; letter-spacing: 0.3px;
}


/* ─────────────────────────────────────────
   MOCKUP: VOLTA STORE
   Negro · Amarillo · Moda urbana
   ───────────────────────────────────────── */
.mock-volta {
    width: 100%; height: 100%;
    background: #0d0d0d;
    display: flex; flex-direction: column;
    overflow: hidden;
}

.mock-volta-nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 16px;
    background: #000;
    border-bottom: 1px solid rgba(245,197,24,0.18);
    flex-shrink: 0;
}

.mock-volta-nav > span {
    font-family: 'GoogleSans', sans-serif;
    font-weight: bold; font-size: clamp(0.75rem, 1.8vw, 0.95rem);
    color: #f5c518; letter-spacing: 5px; text-transform: uppercase;
}

.mock-volta-nav nav {
    font-size: clamp(0.5rem, 1.1vw, 0.6rem);
    color: rgba(255,255,255,0.45); letter-spacing: 1.5px; text-transform: uppercase;
}

.mock-volta-grid {
    flex: 1;
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 2px; background: #1a1a1a;
    padding: 8px; overflow: hidden;
}

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

.mock-volta-item {
    display: flex; flex-direction: column;
    background: #111; padding: 6px; gap: 5px;
}

.mock-img {
    width: 100%; flex: 1; min-height: 48px;
    background: linear-gradient(135deg, #222 0%, #2e2e2e 50%, #252525 100%);
    position: relative; overflow: hidden;
}

.mock-img::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(45deg, transparent 40%, rgba(245,197,24,0.05) 100%);
}

.mock-volta-item p {
    font-family: 'GoogleSans', sans-serif;
    font-size: clamp(0.48rem, 1vw, 0.58rem);
    color: rgba(255,255,255,0.65); margin: 0; line-height: 1.2; letter-spacing: 0.3px;
}

.mock-volta-item span {
    font-family: 'Fira Code', monospace;
    font-size: clamp(0.5rem, 1.1vw, 0.62rem);
    color: #f5c518; font-weight: bold;
}


/* ─────────────────────────────────────────
   MOCKUP: ORIGEN
   Neutros cálidos · Inmobiliaria
   ───────────────────────────────────────── */
.mock-origen {
    width: 100%; height: 100%;
    background: #f8f5f0;
    display: flex; flex-direction: column;
    overflow: hidden;
}

.mock-origen-nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 18px; background: #fff;
    border-bottom: 1px solid #e8ddd2; flex-shrink: 0;
}

.mock-origen-nav > span {
    font-family: 'GoogleSans', sans-serif;
    font-weight: bold; font-size: clamp(0.72rem, 1.8vw, 0.95rem);
    color: #5c4030; letter-spacing: 2.5px; text-transform: uppercase;
}

.mock-origen-nav nav {
    font-size: clamp(0.5rem, 1.1vw, 0.62rem);
    color: #8c6d4f; letter-spacing: 0.5px;
}

.mock-origen-search {
    display: flex; gap: 6px; align-items: center;
    padding: 8px 14px; background: #f0ebe4;
    border-bottom: 1px solid #e0d5c8; flex-shrink: 0;
}

.mock-origen-search input {
    flex: 1; padding: 5px 10px;
    background: #fff; border: 1px solid #d5c8bb;
    border-radius: 3px;
    font-family: 'GoogleSans', sans-serif;
    font-size: clamp(0.5rem, 1.1vw, 0.62rem);
    color: #5c4030; outline: none;
}

.mock-origen-search button {
    padding: 5px 12px;
    background: #8c6d4f; color: #fff; border: none;
    border-radius: 3px; cursor: default;
    font-family: 'GoogleSans', sans-serif; font-weight: bold;
    font-size: clamp(0.5rem, 1.1vw, 0.62rem);
    white-space: nowrap;
}

.mock-origen-listings {
    flex: 1; display: flex; flex-direction: column;
    gap: 6px; padding: 8px 12px; overflow: hidden;
}

.mock-prop {
    display: flex; gap: 8px; align-items: center;
    background: #fff; padding: 6px 8px;
    border-radius: 4px; border: 1px solid #e8ddd2;
}

.mock-prop-img {
    width: 40px; height: 28px; flex-shrink: 0;
    background: linear-gradient(135deg, #d5c8bb 0%, #c8b8a2 100%);
    border-radius: 2px;
}

.mock-prop p {
    font-family: 'GoogleSans', sans-serif;
    font-size: clamp(0.5rem, 1.1vw, 0.6rem);
    color: #4a3828; margin: 0; line-height: 1.35; font-weight: 500;
}


/* ─────────────────────────────────────────
   MOCKUP: FLOWDESK
   Gradiente morado · SaaS
   ───────────────────────────────────────── */
.mock-flowdesk {
    width: 100%; height: 100%;
    background: #0f0a1e;
    display: flex; flex-direction: column;
    overflow: hidden;
}

.mock-fd-nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 18px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(102,126,234,0.18);
    flex-shrink: 0;
}

.mock-fd-nav > span {
    font-family: 'GoogleSans', sans-serif;
    font-weight: bold; font-size: clamp(0.72rem, 1.8vw, 0.92rem);
    background: linear-gradient(90deg, #818cf8, #a78bfa);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; letter-spacing: 0.5px;
}

.mock-fd-nav nav {
    font-size: clamp(0.5rem, 1.1vw, 0.6rem);
    color: rgba(255,255,255,0.3); letter-spacing: 0.5px;
}

.mock-fd-hero {
    flex: 1;
    display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
    padding: 18px 22px;
    background:
        radial-gradient(ellipse at 15% 50%, rgba(102,126,234,0.22) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 80%, rgba(118,75,162,0.16) 0%, transparent 50%);
}

.mock-fd-hero h2 {
    font-family: 'GoogleSans', sans-serif;
    font-size: clamp(0.88rem, 2.8vw, 1.85rem);
    font-weight: bold; color: #fff; line-height: 1.35;
    margin-bottom: 14px;
}

.mock-fd-hero button {
    font-family: 'GoogleSans', sans-serif; font-weight: bold;
    font-size: clamp(0.52rem, 1.2vw, 0.7rem);
    background: linear-gradient(90deg, #667eea, #764ba2);
    color: #fff; border: none; padding: 7px 16px;
    border-radius: 999px; cursor: default;
}

.mock-fd-pricing {
    display: flex; gap: 6px;
    padding: 10px 14px;
    background: rgba(0,0,0,0.28);
    border-top: 1px solid rgba(102,126,234,0.14);
    flex-shrink: 0;
}

.mock-fd-plan {
    flex: 1; background: rgba(255,255,255,0.04);
    border: 1px solid rgba(102,126,234,0.2);
    border-radius: 6px; padding: 8px 6px; text-align: center;
}

.mock-fd-plan.mock-fd-popular {
    background: rgba(102,126,234,0.13);
    border-color: rgba(102,126,234,0.5);
}

.mock-fd-plan strong {
    display: block;
    font-size: clamp(0.58rem, 1.2vw, 0.65rem);
    font-family: 'GoogleSans', sans-serif;
    color: #e2d9f3; margin-bottom: 3px; letter-spacing: 0.5px;
}

.mock-fd-plan > p {
    font-family: 'Fira Code', monospace;
    font-size: clamp(0.6rem, 1.3vw, 0.72rem);
    color: #818cf8; font-weight: bold; margin: 0;
}

.mock-fd-plan ul {
    list-style: none; margin: 5px 0 0; padding: 0;
}

.mock-fd-plan ul li {
    font-size: clamp(0.48rem, 1vw, 0.55rem);
    font-family: 'Fira Code', monospace;
    color: rgba(255,255,255,0.38); line-height: 1.65;
}


/* ─────────────────────────────────────────
   AUTOMATIZACIÓN: FLUJOS GRID
   ───────────────────────────────────────── */
.flujos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 10px;
}

.flujo-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 18px 16px;
    display: flex; flex-direction: column; gap: 8px;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.flujo-card:hover {
    border-color: rgba(255,0,51,0.35);
    box-shadow: 0 4px 20px rgba(255,0,51,0.07);
}

.flujo-card h4 {
    font-family: 'Fira Code', monospace;
    font-size: 0.88rem; font-weight: bold;
    color: var(--text-main); margin: 0;
}

.flujo-desc {
    font-size: 0.72rem; color: var(--text-muted);
    line-height: 1.5; margin: 0;
}

.flujo-svg {
    width: 100%; height: auto;
    margin-top: 4px; overflow: visible;
}

@media (max-width: 900px) {
    .flujos-grid { grid-template-columns: 1fr; }
}


/* ─────────────────────────────────────────
   CHAT DEMO
   ───────────────────────────────────────── */
.chat-demo-wrapper {
    margin-top: 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-surface);
}

.chat-demo-title {
    font-family: 'Fira Code', monospace;
    font-size: 0.88rem; font-weight: bold;
    color: var(--text-main);
    margin: 0; padding: 14px 18px 2px;
}

.chat-demo-subtitle {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem; color: var(--text-muted);
    margin: 0; padding: 0 18px 12px;
    border-bottom: 1px solid var(--border);
}

.chat-demo {
    display: flex; flex-direction: column;
    height: 320px;
}

.chat-messages {
    flex: 1; overflow-y: auto;
    padding: 16px;
    display: flex; flex-direction: column; gap: 10px;
    scrollbar-width: none !important;
}

.chat-messages::-webkit-scrollbar { display: none !important; }

.chat-msg {
    max-width: 80%;
    padding: 10px 14px;
    font-family: 'GoogleSans', sans-serif;
    font-size: 0.85rem; line-height: 1.55;
    word-break: break-word;
}

.chat-msg-bot {
    align-self: flex-start;
    background: var(--bg-card);
    color: var(--text-body);
    border: 1px solid var(--border);
    border-radius: 4px 12px 12px 12px;
}

.chat-msg-user {
    align-self: flex-end;
    background: rgba(255,0,51,0.1);
    color: var(--text-main);
    border: 1px solid rgba(255,0,51,0.2);
    border-radius: 12px 4px 12px 12px;
}

.chat-msg-error {
    background: rgba(255,80,80,0.07);
    border-color: rgba(255,80,80,0.22);
    color: #ff6b6b;
}

/* Puntos animados "pensando" */
.chat-thinking {
    display: flex !important;
    align-items: center; gap: 5px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px 12px 12px 12px;
    align-self: flex-start;
    max-width: 80px;
}

.chat-thinking span {
    display: inline-block;
    width: 6px; height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: chatBounce 1.25s ease-in-out infinite;
}

.chat-thinking span:nth-child(2) { animation-delay: 0.2s; }
.chat-thinking span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chatBounce {
    0%, 80%, 100% { transform: translateY(0) scale(0.75); opacity: 0.4; }
    40%           { transform: translateY(-5px) scale(1); opacity: 1; }
}

.chat-input-row {
    display: flex;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}

#chat-input {
    flex: 1; background: transparent; border: none; outline: none;
    padding: 12px 16px;
    color: var(--text-main);
    font-family: 'Fira Code', monospace; font-size: 0.85rem;
}

#chat-input::placeholder { color: var(--text-muted); }

#chat-send-btn {
    background: transparent;
    border: none; border-left: 1px solid var(--border);
    color: var(--text-muted);
    padding: 12px 18px; cursor: pointer; font-size: 1rem;
    transition: color 0.2s, background 0.2s;
}

#chat-send-btn:hover {
    color: var(--accent);
    background: var(--accent-dim);
}

#chat-send-btn:disabled {
    opacity: 0.35; pointer-events: none;
}


/* ─────────────────────────────────────────
   SCRIPTS / PYTHON
   ───────────────────────────────────────── */
.scripts-grid {
    display: flex; flex-direction: column;
    gap: 22px; margin-top: 10px;
}

.script-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 6px; overflow: hidden;
    transition: border-color 0.25s;
}

.script-card:hover { border-color: var(--border-hover); }

.script-card-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 16px; padding: 16px 20px 14px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.script-card-header > div { flex: 1; }

.script-card-header h4 {
    font-family: 'GoogleSans', sans-serif;
    font-size: 0.95rem; color: var(--text-main); margin: 0 0 4px;
}

.script-desc {
    font-size: 0.78rem; color: var(--text-muted);
    margin: 0; line-height: 1.5;
}

.btn-github {
    display: inline-flex; align-items: center; gap: 7px;
    color: var(--text-muted);
    text-decoration: none;
    font-family: 'Fira Code', monospace; font-size: 0.72rem;
    border: 1px solid var(--border-mid);
    padding: 5px 12px; border-radius: 4px;
    white-space: nowrap; flex-shrink: 0;
    transition: color 0.2s, border-color 0.2s;
}

.btn-github:hover {
    color: var(--text-main);
    border-color: var(--border-hover);
}

.btn-github i { font-size: 0.88rem; }

/* Bloque de código */
.code-block {
    margin: 0; padding: 18px 22px;
    background: #060606;
    overflow-x: auto !important;
    white-space: pre !important;
    width: 100%;
    box-sizing: border-box;
    font-family: 'Fira Code', monospace;
    font-size: 0.82rem; line-height: 1.75;
    color: #cdd6f4;
    tab-size: 4;
    scrollbar-width: thin;
    scrollbar-color: var(--border-mid) transparent;
}

.code-block::-webkit-scrollbar { height: 4px; }
.code-block::-webkit-scrollbar-track { background: transparent; }
.code-block::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 2px; }

.code-block code {
    font-family: inherit; font-size: inherit;
    background: none; color: inherit;
}

/* Tokens de sintaxis — Catppuccin Mocha palette */
.kw  { color: #cba6f7; }            /* morado   — keywords (import, def, for…)  */
.fn  { color: #89b4fa; }            /* azul     — nombres de función             */
.st  { color: #a6e3a1; }            /* verde    — strings                        */
.nu  { color: #fab387; }            /* naranja  — números                        */
.op  { color: #89dceb; }            /* cian     — operadores, flechas            */
.co  { color: #49505e; font-style: italic; }  /* gris   — comentarios            */

@media (max-width: 768px) {
    .script-card-header {
        flex-direction: column; gap: 10px;
    }
    .code-block {
        font-size: 0.72rem; padding: 14px 14px;
    }
}


/* ─────────────────────────────────────────
   SYNTAX HIGHLIGHT — token .cm (comentarios)
   El HTML usa <span class="cm"> — .co era alias
   incorrecto que no se renderizaba en los bloques
   ───────────────────────────────────────── */
.cm { color: #6c7086; font-style: italic; }


/* ─────────────────────────────────────────
   MOCKUP HEROES — overlay de marca
   sobre la foto de fondo (Unsplash/picsum).
   El inline background-image reemplaza el
   gradient del CSS, así que el overlay se
   aplica como pseudo-elemento ::before
   posicionado sobre la imagen.
   ───────────────────────────────────────── */
.mock-noir-hero,
.mock-salud-hero,
.mock-fd-hero {
    position: relative;
}

.mock-noir-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(4, 4, 4, 0.52) 0%,
        rgba(4, 4, 4, 0.70) 100%
    );
    z-index: 0;
    pointer-events: none;
}

.mock-salud-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(21, 101, 192, 0.72) 0%,
        rgba(21, 101, 192, 0.38) 100%
    );
    z-index: 0;
    pointer-events: none;
}

.mock-fd-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 15% 50%, rgba(102, 126, 234, 0.52) 0%, transparent 55%),
        linear-gradient(180deg, rgba(15, 10, 30, 0.80) 0%, rgba(15, 10, 30, 0.46) 100%);
    z-index: 0;
    pointer-events: none;
}

/* Los hijos directos deben ir por encima del overlay */
.mock-noir-hero > *,
.mock-salud-hero > *,
.mock-fd-hero > * {
    position: relative;
    z-index: 1;
}


/* ─────────────────────────────────────────
   MODAL FULL VARIANTS
   Ajustes para los mockups dentro del modal
   (modal-inner: max 840px × 88vh/660px)
   ───────────────────────────────────────── */

/* NOIR — menú de platos en 2 columnas en modal */
.mock-noir-full .mock-noir-items {
    flex-wrap: wrap;
    padding: 10px 14px;
}

.mock-noir-full .mock-noir-items > div {
    flex: 0 0 50%;
    border-right: none;
    border-bottom: 1px solid rgba(200, 169, 110, 0.08);
    padding: 8px 6px;
}

.mock-noir-full .mock-noir-items > div:nth-last-child(-n+2) {
    border-bottom: none;
}

/* SALUD — 4 especialidades en 2 × 2 en modal */
.mock-salud-full .mock-salud-cards {
    gap: 8px;
    padding: 12px 16px;
}

.mock-salud-full .mock-salud-cards > div {
    flex: 1 0 calc(50% - 4px);
}

/* VOLTA — imágenes más altas en la grid 3-col del modal */
.mock-volta-full .mock-img {
    min-height: 90px;
}

/* ORIGEN — tarjetas de propiedad más grandes en modal */
.mock-origen-full .mock-origen-listings {
    gap: 10px;
    padding: 10px 14px;
}

.mock-origen-full .mock-prop-img {
    width: 72px;
    height: 50px;
    border-radius: 3px;
}

.mock-origen-full .mock-prop p {
    font-size: clamp(0.62rem, 1.3vw, 0.74rem);
    font-weight: 600;
}

/* FLOWDESK — pricing más espaciado + lista de features visible */
.mock-flowdesk-full .mock-fd-pricing {
    padding: 14px 18px;
    gap: 10px;
}

.mock-flowdesk-full .mock-fd-plan {
    padding: 12px 10px;
}

.mock-flowdesk-full .mock-fd-plan strong {
    font-size: 0.72rem;
    margin-bottom: 5px;
}

.mock-flowdesk-full .mock-fd-plan > p {
    font-size: 0.84rem;
    margin-bottom: 7px;
}

.mock-flowdesk-full .mock-fd-plan ul {
    display: block;
}

.mock-flowdesk-full .mock-fd-plan ul li {
    color: rgba(255, 255, 255, 0.52);
    line-height: 1.8;
}

.mock-flowdesk-full .mock-fd-plan ul li::before {
    content: '✓ ';
    color: #818cf8;
    font-weight: bold;
}


/* PUNTOS ROJOS — títulos de servicios */
.punto-rojo { font-size: 4rem !important; color: var(--accent) !important; line-height: 0 !important; vertical-align: middle !important; display: inline-block; position: relative; top: -18px !important; margin-right: 10px !important; }
section#servicios h3, section#proyectos h3, section#certificaciones h3 { display: flex !important; align-items: center !important; margin: 0; }

/* GITHUB PROFILE LINK — sección proyectos */
.github-profile-link {
    display: block;
    text-align: center;
    font-family: 'Fira Code', monospace;
    font-size: 0.95rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 10px 0 30px;
    transition: color 0.25s ease;
    letter-spacing: 0.03em;
}

.github-profile-link i {
    margin-right: 8px;
    font-size: 1.05rem;
}

.github-profile-link:hover {
    color: var(--accent);
}

/* LOGO — navegable al inicio */
.logo {
    cursor: pointer;
}

/* ─────────────────────────────────────────
   SERVICIOS — LAYOUT ZIG-ZAG (2 columnas)
   ───────────────────────────────────────── */
.srv-zigzag {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: flex-start !important;
}

.srv-col-text {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-right: 24px;
}

.srv-col-visual {
    display: flex;
    flex-direction: column;
}

.srv-col-visual .proyectos-lista {
    margin-top: 0;
}

/* Bloque 2: visual aparece a la izquierda en desktop */
.srv-zigzag-rev .srv-col-visual {
    order: -1;
}

/* Automatización: chat izquierda, texto+flujos derecha */
.srv-auto-layout {
    align-items: stretch;
}

.srv-chat-col {
    display: flex;
    flex-direction: column;
}

.srv-chat-col .chat-demo-wrapper {
    flex: 1;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    min-height: 380px;
}

.srv-chat-col .chat-demo-wrapper .chat-demo {
    flex: 1;
    height: auto;
    min-height: 280px;
}

/* Scripts carousel */
.scripts-carousel { position: relative; height: auto; width: 100% !important; max-width: 600px !important; flex: 0 0 auto !important; overflow: hidden; }

/* Columna visual de scripts — anchura rígida, sin expansión por contenido */
#srv-scripts .srv-col-visual {
    min-width: 0;
    max-width: 600px;
    overflow: hidden;
}

.scripts-carousel .script-card {
    display: none;
}

.scripts-carousel .script-card.carousel-active {
    display: block;
}

.carousel-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 6px 6px;
    justify-content: flex-end;
}

.carousel-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-mid);
    color: var(--text-muted);
    padding: 2px 11px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.15rem;
    line-height: 1.5;
    font-family: 'Fira Code', monospace;
    transition: color 0.2s, border-color 0.2s;
}

.carousel-btn:hover {
    color: var(--text-main);
    border-color: var(--border-hover);
}

.carousel-counter {
    font-family: 'Fira Code', monospace;
    font-size: 0.78rem;
    color: var(--text-muted);
    min-width: 36px;
    text-align: center;
}

/* Flujos debajo del layout de automatización — grid horizontal */
#srv-auto .flujos-grid {
    grid-template-columns: repeat(3, 1fr);
    margin-top: 24px;
}

/* Hero paragraphs — spacing sin <br> */
.hero-content > p {
    margin-top: 18px;
    margin-bottom: 4px;
}

@media (max-width: 900px) {
    .srv-zigzag {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .srv-zigzag-rev .srv-col-visual {
        order: 0;
    }

    .srv-col-text {
        padding-right: 0;
    }
}

@media (max-width: 768px) {
    #srv-auto .srv-auto-layout {
        display: flex;
        flex-direction: column;
    }

    #srv-auto .srv-col-text {
        order: 1;
    }

    #srv-auto .srv-chat-col {
        order: 2;
    }

    #srv-auto .flujos-grid {
        order: 3;
    }
}

/* Scripts — anclar columna de texto arriba independientemente del carrusel */
#srv-scripts .srv-col-text {
    align-self: flex-start !important;
}

/* Modal iframe — tamaño y botón GitHub */
.modal-iframe-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 90vw !important;
    max-width: 1000px !important;
    height: auto !important;
    max-height: none;
    overflow-y: auto !important;
    padding: 2rem !important;
    box-sizing: border-box !important;
    border-radius: 16px !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 30px 90px rgba(0,0,0,0.9);
    position: relative;
}

.modal-iframe-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    width: 100%;
    padding: 1.25rem;
    flex: 1;
    min-height: 0;
}

.modal-iframe {
    width: 100% !important;
    height: 600px !important;
    border: none !important;
    margin: 0 !important;
    border-radius: 12px;
    display: block;
}

.modal-iframe-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 14px 20px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.section-footer { text-align: center !important; padding: 60px 0 20px 0 !important; width: 100% !important; clear: both !important; display: block !important; font-size: 0.75rem; color: rgba(255, 255, 255, 0.4); }
.section-footer a { color: rgba(255, 255, 255, 0.4); transition: color 0.3s; }
.section-footer a:hover { color: var(--accent); }
body.light .section-footer,
body.light .section-footer a { color: rgba(0, 0, 0, 0.5) !important; }
body.light .section-footer a:hover { color: var(--accent) !important; }


/* ─── MODAL: color de enlaces ─── */
.mockup-modal a,
#contactModal a,
#privacidadModal a,
#cookiesModal a {
    color: var(--accent) !important;
    text-decoration: none;
    font-weight: bold;
    transition: opacity 0.3s;
}
.mockup-modal a:hover,
#contactModal a:hover,
#privacidadModal a:hover,
#cookiesModal a:hover {
    opacity: 0.8;
}

/* Repositorio Snake — botón GitHub como flex item fijo */
#modal-snake .btn-github {
    flex: 0 0 auto !important;
    margin-top: 1rem !important;
}

/* Repositorio Snake — usa color neutro, no acento rojo */
#modal-snake .btn-github {
    color: var(--text-main) !important;
    font-weight: normal;
}
#modal-snake .btn-github:hover {
    color: var(--text-main) !important;
    opacity: 0.75;
}

/* ELIMINAR PUNTO PEQUEÑO EN PROYECTOS Y CERTIFICACIONES */
section#proyectos ul, section#certificaciones ul { list-style-type: none !important; padding-left: 0 !important; margin-left: 0 !important; margin-bottom: 0 !important; padding-bottom: 0 !important; }
section#proyectos li, section#certificaciones li { list-style-type: none !important; }
section#proyectos .servicio-bloque { padding-bottom: 20px !important; margin-bottom: 0 !important; }

/* CORTAFUEGOS: ocultar li vacíos o con único hijo vacío en proyectos */
section#proyectos li:empty,
section#proyectos li:has(> *:empty:only-child) { display: none !important; border: none !important; padding: 0 !important; margin: 0 !important; }

/* ─── MODAL PRIVACIDAD / COOKIES: bordes redondeados ─── */
#contactModal > div,
#privacidadModal > div,
#cookiesModal > div {
    border-radius: 24px !important;
}

#privacidadModal button[onclick],
#cookiesModal button[onclick] {
    border-radius: 9999px !important;
    padding: 10px 28px !important;
}

/* ENTIDADES EMISORAS — CERTIFICACIONES */
.entity-badge {
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 9999px !important;
    padding: 4px 12px !important;
    font-size: 0.75rem;
    background: transparent;
    color: rgba(255,255,255,0.7);
    display: inline-block;
}

body.light .entity-badge {
    border-color: rgba(0,0,0,0.2);
    color: rgba(0,0,0,0.7);
}

/* ÚLTIMA LÍNEA PROYECTOS — eliminar borde y hueco sobrante */
section#proyectos ul { border-bottom: none !important; margin-bottom: 0 !important; }
section#proyectos li:last-child { border-bottom: none !important; padding-bottom: 0 !important; margin-bottom: 0 !important; }
section#proyectos .servicio-bloque { border-bottom: none !important; }

/* ─── RESPONSIVIDAD MÓVIL ─── */
@media (max-width: 768px) {
    .chat-demo-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0;
    }

    .modal-inner {
        width: 95% !important;
        max-height: 95vh;
        overflow: hidden !important;
    }

    .modal-iframe-wrap {
        width: 95% !important;
        max-height: 95vh;
        overflow: hidden !important;
    }
}

/* SITE FOOTER — reemplazado por .legal-links, ocultar el original */
.site-footer { display: none !important; }

/* Footer Final y Limpio */
.final-page-footer { display: block !important; width: 100% !important; text-align: center !important; padding: 60px 0 30px 0 !important; background: transparent !important; clear: both !important; }
.footer-link { color: rgba(255, 255, 255, 0.6) !important; text-decoration: none !important; font-size: 0.85rem !important; transition: color 0.3s ease; }
.footer-link:hover { color: var(--accent) !important; text-decoration: underline !important; }

/* Botón de Correo en Forma de Píldora */
.email-button, #email-btn, .contact-trigger, #fab-contact { border-radius: 9999px !important; aspect-ratio: auto !important; }
.email-button, #email-btn, .contact-trigger { padding: 10px 24px !important; }

/* Intro de sección — proyectos y certificaciones */
.section-intro { font-size: 0.95rem; color: var(--text-body); line-height: 1.7; margin-top: 10px; }

/* ANCHO MÁXIMO — más espacio de contenido */
.container, .servicios-container { max-width: 1400px !important; width: 95% !important; margin: 0 auto !important; }

/* BLOQUES INTERNOS */
.servicio-bloque {
    width: 100% !important;
    max-width: 1100px !important;
    margin: 0 auto !important;
}

/* ─── MÓVIL ≤768px ─── */
@media (max-width: 768px) {
    /* Títulos en 2 líneas */
    section#proyectos h3, section#certificaciones h3 {
        max-width: 320px !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        line-height: 1.3 !important;
    }
    .servicio-bloque { flex-direction: column !important; }

    /* Nav móvil — barra resucitada */
    .mobile-nav-bar {
        height: 60px !important;
        display: flex !important;
        align-items: flex-end !important;
        padding-bottom: 8px !important;
        z-index: 1000 !important;
    }
    .mobile-nav-link {
        color: var(--text-muted) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: auto !important;
        padding: 0 10px !important;
        padding-top: 0 !important;
        margin: 0 !important;
        line-height: 1 !important;
        font-size: 14px !important;
        transform: none !important;
    }
    .mobile-nav-link.activo-fijo,
    .mobile-nav-link.nav-active { color: #e63946 !important; }

    /* Padding superior para compensar cabecera doble fija */
    section {
        padding-top: 140px !important;
        margin-top: 0 !important;
    }

    /* Chat demo — ancho completo en móvil */
    .srv-chat-col,
    .chat-demo-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        flex: 1 1 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* Evitar cortes de contenido — tarjetas y bloques */
    .servicio-bloque, .texto-legal {
        height: auto !important;
        min-height: min-content !important;
        overflow: visible !important;
        padding-bottom: 20px !important;
        max-height: none !important;
    }

    /* Footer local — móvil */
    .footer-local {
        margin-top: 40px !important;
        padding-bottom: 140px !important;
    }

    /* Nav móvil — micro-empujón visual del texto hacia abajo */
    .mobile-nav-link {
        transform: translateY(3px) !important;
    }
}

/* SECCIÓN ACTIVA — color rojo persistente */
nav a.activo-fijo,
.mobile-nav-link.activo-fijo { color: #e63946 !important; }

/* MENÚ HAMBURGUESA — eliminar completamente */
.menu-toggle, .mobile-menu-btn, .hamburger, .nav-toggle { display: none !important; pointer-events: none !important; }

/* ANCHO Y ALINEACIÓN GENERAL */
.container { max-width: 1600px !important; width: 94% !important; margin: 0 auto !important; }
#certificaciones ul { margin-left: 0 !important; padding-left: 20px !important; }

/* SCROLL — lienzo completo con espacio para el footer */
html, body {
    position: relative !important;
    min-height: 100vh !important;
    height: auto !important;
    display: block !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding-bottom: 150px !important;
}

/* MENÚ MÓVIL — barra horizontal estática, una línea */
.mobile-nav-bar { display: none; }

@media (max-width: 900px) {
    .mobile-nav-bar {
        height: 50px !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: space-evenly !important;
        align-items: center !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
        background: color-mix(in srgb, var(--bg-dark) 97%, transparent);
        border-bottom: 1px solid var(--border);
        position: fixed;
        top: 53px;
        left: 0;
        z-index: 999;
        backdrop-filter: blur(5px);
    }
    .mobile-nav-link {
        flex: 1 1 0;
        min-width: 0;
        align-self: center !important;
        color: var(--text-muted);
        text-decoration: none;
        font-family: 'Fira Code', monospace;
        font-size: clamp(10px, 2.6vw, 14px) !important;
        letter-spacing: -0.2px !important;
        line-height: normal !important;
        padding: 0 !important;
        margin: 0 !important;
        display: block !important;
        border-radius: 999px;
        transition: color 0.2s, background 0.2s;
        white-space: nowrap;
        text-align: center;
    }
    .mobile-nav-link:hover,
    .mobile-nav-link.nav-active { color: var(--accent); background: var(--accent-dim); }
    .mobile-nav-cv {
        background: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 0 4px !important;
        margin: 0 !important;
        box-shadow: none !important;
        color: var(--accent) !important;
        font-weight: bold;
        flex: 0 0 auto;
        margin-right: 10px !important;
        font-size: clamp(10px, 2.6vw, 14px) !important;
    }

    /* HEADER — logo izquierda, selectores idioma/tema derecha */
    .nav-left {
        flex: 1 !important;
    }
    .logo {
        margin-right: auto !important;
    }

    /* PROYECTOS Y CERTIFICACIONES EN MÓVIL — stack vertical, sin Z */
    section#proyectos .srv-zigzag,
    section#certificaciones .srv-zigzag {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
    }
    section#proyectos .srv-col-text,
    section#proyectos .srv-col-visual,
    section#certificaciones .srv-col-text,
    section#certificaciones .srv-col-visual {
        width: 100% !important;
        max-width: 100% !important;
        padding-right: 0 !important;
        order: unset !important;
        overflow: visible !important;
    }
    .proy-nombre { font-size: 0.92rem !important; }
}

/* BOTÓN CONTACTO FLOTANTE — píldora "Escríbeme" */
.floating-contact, .btn-correo, #fab-contact {
    border-radius: 9999px !important;
    padding: 12px 24px !important;
    width: auto !important;
    height: auto !important;
    aspect-ratio: auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 0.85rem !important;
    font-family: 'Fira Code', monospace !important;
}

/* ANCHO MÁXIMO GENERAL */
.servicios-container { max-width: 1400px !important; }

/* ─── LAYOUT ESCRITORIO — proyectos/certificaciones ─── */
@media (min-width: 769px) {
    /* Foto de perfil — alineada con "Desarrollador especializado" */
    .hero-image {
        align-self: flex-start !important;
        margin-top: 165px !important;
        position: relative !important;
    }
    .profile-pic {
        width: 280px !important;
        height: 280px !important;
    }
    section#proyectos, section#certificaciones {
        max-width: 1400px !important;
        width: 90% !important;
        margin: 0 auto !important;
    }
    section#proyectos h3, section#certificaciones h3 {
        max-width: 100% !important;
        white-space: normal !important;
        text-align: left !important;
    }

    /* Chatbot fijo: visual (chat) siempre izquierda, texto siempre derecha */
    #srv-auto .srv-auto-layout {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
    }
    #srv-auto .srv-chat-col { order: 1 !important; }
    #srv-auto .srv-col-text  { order: 2 !important; }

    /* ── Certificaciones: columnas 48/48 idénticas a Proyectos ── */
    section#certificaciones .servicio-bloque {
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 80px !important;
    }
    section#certificaciones .srv-zigzag {
        display: flex !important;
        flex-direction: row !important;
        align-items: flex-start !important;
        justify-content: space-between !important;
        gap: 60px !important;
    }
    section#certificaciones .srv-col-text,
    section#certificaciones .srv-col-visual {
        width: 48% !important;
        max-width: 48% !important;
        flex: 0 0 48% !important;
    }
    /* Zigzag inverso — orden explícito para no conflictar con order:-1 global */
    section#certificaciones .inverso .srv-col-visual {
        order: 1 !important;
    }
    section#certificaciones .inverso .srv-col-text {
        order: 2 !important;
    }
}


/* ─── MODALES LEGALES — footer ─── */
.modal-legal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}
.modal-legal.activo { display: flex !important; }
.modal-contenido {
    background: #0a0a0a;
    color: #a0a0a0;
    padding: 40px;
    border-radius: 15px;
    border: 1px solid #e63946;
    box-shadow: 0 0 20px rgba(230, 57, 70, 0.4);
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    font-family: 'Fira Code', 'Courier New', monospace;
}
.modal-contenido h2 {
    color: #e63946;
    font-size: 1.5rem;
    margin-bottom: 25px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-weight: bold;
}
.cerrar-modal {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 35px;
    color: #888;
    cursor: pointer;
    font-family: sans-serif;
    font-weight: 100;
    line-height: 1;
}
.cerrar-modal:hover { color: #e63946; }
.texto-legal p {
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 20px;
}
.texto-legal strong {
    color: #e0e0e0;
    display: block;
    margin-bottom: 8px;
}
.texto-legal a {
    color: #e63946;
    text-decoration: none;
}

/* ─── MODALES — modo claro ─── */
body.light #contactModal > div,
body.light #privacidadModal > div,
body.light #cookiesModal > div {
    background: #ffffff !important;
    border-color: var(--accent) !important;
    color: #222222 !important;
}
body.light #contactModal h2,
body.light #privacidadModal h3,
body.light #cookiesModal h3 {
    color: var(--accent) !important;
}
body.light #contactModal p,
body.light #privacidadModal p,
body.light #cookiesModal p,
body.light #contactModal label,
body.light #contactModal input,
body.light #contactModal textarea {
    color: #444444 !important;
}
body.light #contactModal input,
body.light #contactModal textarea {
    background: #f5f5f5 !important;
    border-color: #cccccc !important;
}
body.light #privacidadModal a,
body.light #cookiesModal a {
    color: var(--accent) !important;
}
/* Modal-legal (políticas del footer) — modo claro */
body.light .modal-legal .modal-contenido {
    background: #ffffff !important;
    border-color: var(--accent) !important;
    color: #444444 !important;
}
body.light .modal-legal .modal-contenido h2 {
    color: var(--accent) !important;
}
body.light .modal-legal .texto-legal p { color: #444444 !important; }
body.light .modal-legal .texto-legal strong { color: #222222 !important; }
body.light .modal-legal .texto-legal a { color: var(--accent) !important; }

/* ─── BOTONES FLOTANTES — clase maestra circular ─── */
.btn-flotante-circular {
    position: fixed !important;
    bottom: 25px !important;
    width: 55px !important;
    height: 55px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 2px solid #e63946 !important;
    color: #e63946 !important;
    z-index: 999990 !important;
    cursor: pointer !important;
    padding: 0 !important;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease !important;
    background-color: #0a0a0a !important;
}
body.light .btn-flotante-circular {
    background-color: #ffffff !important;
}
.btn-flotante-circular:hover {
    background-color: #e63946 !important;
    color: #ffffff !important;
    transform: scale(1.08) !important;
}
@media (max-width: 768px) {
    .btn-flotante-circular { width: 48px !important; height: 48px !important; bottom: 20px !important; }
}

/* ─── Z-INDEX Y POINTER-EVENTS — todos los modales ─── */
#contactModal, #privacidadModal, #cookiesModal,
.modal-legal, #modal-legal-menu {
    z-index: 999999 !important;
}
#contactModal > div, #privacidadModal > div, #cookiesModal > div,
.modal-legal .modal-contenido, #modal-legal-menu > div {
    pointer-events: auto !important;
    z-index: 1000000 !important;
}

/* ─── MODO CLARO — modales ─── */
body.light #contactModal > div,
body.light #privacidadModal > div,
body.light #cookiesModal > div {
    background: #ffffff !important;
    border-color: var(--accent) !important;
    color: #222222 !important;
}
body.light #contactModal h2,
body.light #privacidadModal h3,
body.light #cookiesModal h3 { color: var(--accent) !important; }
body.light #contactModal p,
body.light #privacidadModal p,
body.light #cookiesModal p,
body.light #contactModal label { color: #444444 !important; }
body.light #contactModal input,
body.light #contactModal textarea {
    background: #f5f5f5 !important;
    border-color: #cccccc !important;
    color: #222 !important;
}
body.light #privacidadModal a,
body.light #cookiesModal a { color: var(--accent) !important; }
body.light .modal-legal .modal-contenido {
    background: #ffffff !important;
    color: #444444 !important;
}
body.light .modal-legal .modal-contenido h2 { color: var(--accent) !important; }
body.light .modal-legal .texto-legal p { color: #444444 !important; }
body.light .modal-legal .texto-legal strong { color: #222222 !important; }
body.light .modal-legal .texto-legal a { color: var(--accent) !important; }
body.light .cerrar-modal { color: #999999 !important; }
body.light #modal-legal-menu > div { background: #ffffff !important; color: #222 !important; }

/* ─── BOX-SIZING GLOBAL ─── */
*, *::before, *::after { box-sizing: border-box !important; }
body.light .cerrar-modal { color: #999999 !important; }


/* ─── MODO CLARO — overlay traslúcido efecto cristal ─── */
body.light #contactModal,
body.light #privacidadModal,
body.light #cookiesModal,
body.light .modal-legal,
body.light #modal-legal-menu {
    background: rgba(255,255,255,0.3) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

/* ─── MODO CLARO — overlays y contenidos ─── */
body.light #contactModal > div,
body.light #privacidadModal > div,
body.light #cookiesModal > div,
body.light .modal-legal .modal-contenido,
body.light #modal-legal-menu > div {
    background: #ffffff !important;
    border-color: #d0d0d0 !important;
    box-shadow: 0 15px 50px rgba(0,0,0,0.15) !important;
    color: #111111 !important;
}
body.light #contactModal > div *,
body.light #privacidadModal > div *,
body.light #cookiesModal > div *,
body.light .modal-legal .modal-contenido *,
body.light #modal-legal-menu > div * { color: #111111 !important; }
body.light #contactModal > div a,
body.light #privacidadModal > div a,
body.light #cookiesModal > div a,
body.light .modal-legal .texto-legal a { color: var(--accent) !important; }
body.light .modal-close,
body.light .cerrar-modal,
body.light .cerrar-modal-btn { color: #555555 !important; }
body.light .modal-close:hover,
body.light .cerrar-modal:hover,
body.light .cerrar-modal-btn:hover { color: var(--accent) !important; }

/* ─── CIERRE X — visibilidad en modo oscuro y claro ─── */
.modal-close, .cerrar-modal-btn {
    position: absolute;
    top: 15px; right: 20px;
    font-size: 32px;
    cursor: pointer !important;
    z-index: 1000000 !important;
    background: none; border: none;
    color: #888; line-height: 1;
}
.modal-close:hover, .cerrar-modal-btn:hover { color: var(--accent) !important; }


/* ─── CURSOR LÁSER ROJO ─── */
#cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background-color: #e63946;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999999 !important;
    transform: translate(-50%, -50%);
    transition: width 0.15s ease-out, height 0.15s ease-out, background-color 0.15s ease-out;
}
@media (pointer: fine) {
    *, *::before, *::after { cursor: none !important; }
}
@media (pointer: coarse) {
    #cursor-dot { display: none !important; }
}

/* ─── HOVER BOTONES FLOTANTES — siempre rojo, cualquier tema ─── */
body.light .btn-flotante-circular:hover,
.btn-flotante-circular:hover {
    background-color: #e63946 !important;
    color: #ffffff !important;
    border-color: #e63946 !important;
    transform: scale(1.08) !important;
}

/* ─── CURSOR NONE EN MODALES — anula inline cursor:pointer ─── */
@media (pointer: fine) {
    #contactModal *, #privacidadModal *, #cookiesModal *,
    #modal-legal-menu *, #modal-privacidad *, #modal-cookies *,
    .btn-flotante-circular, button, a, input, textarea,
    .cerrar-modal, .modal-close {
        cursor: none !important;
    }
}
