:root {
    /* MODO OSCURO (Base) */
    --bg-base: #07090e; 
    --bg-surface: rgba(18, 25, 38, 0.6);
    --text-main: #f8fafc; 
    --text-muted: #94a3b8;
    --accent-calipso: #00e5ff; 
    --accent-blue: #0055ff;
    --glass-bg: rgba(7, 9, 14, 0.75); 
    --border-subtle: rgba(255, 255, 255, 0.08);
    --glow-color: rgba(0, 229, 255, 0.15); 
    --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    --shadow-depth: 0 20px 40px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] {
    /* MODO CLARO */
    --bg-base: #fafafc; 
    --bg-surface: #ffffff; 
    --text-main: #1e293b; 
    --text-muted: #64748b;
    --glass-bg: rgba(250, 250, 252, 0.85); 
    --border-subtle: rgba(0, 0, 0, 0.1); 
    --glow-color: rgba(0, 85, 255, 0.05); 
    --shadow-depth: 0 10px 30px rgba(0, 0, 0, 0.05); 
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; } 

body { 
    background-color: var(--bg-base); 
    color: var(--text-main); 
    transition: background-color 0.4s ease, color 0.4s ease; 
    min-height: 100vh; 
    overflow-x: hidden; 
    position: relative; 
}

.bg-glow { 
    position: fixed; 
    top: -20vh; 
    left: -10vw; 
    width: 60vw; 
    height: 60vw; 
    background: radial-gradient(circle, var(--glow-color) 0%, transparent 60%); 
    z-index: -1; 
    pointer-events: none; 
    transition: var(--transition-smooth); 
}

.nav-core { 
    position: fixed; 
    top: 0; 
    width: 100%; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 1.2rem 5%; 
    background: var(--glass-bg); 
    backdrop-filter: blur(16px); 
    -webkit-backdrop-filter: blur(16px); 
    border-bottom: 1px solid var(--border-subtle); 
    z-index: 100; 
}

.brand { font-weight: 800; font-size: 1.3rem; letter-spacing: -0.5px; } 

.nav-links { display: flex; gap: 1.8rem; align-items: center; } 

button { background: none; border: none; cursor: pointer; color: inherit; outline: none; } 

.nav-item { 
    font-weight: 600; 
    font-size: 0.95rem; 
    color: var(--text-muted); 
    transition: var(--transition-smooth); 
}

.nav-item:hover, .nav-item.active { 
    color: var(--accent-calipso); 
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.3); 
}

.btn-login { 
    display: flex; 
    align-items: center; 
    gap: 0.5rem; 
    padding: 0.5rem 1.2rem; 
    border-radius: 8px; 
    border: 1px solid var(--border-subtle); 
    background: var(--bg-surface); 
    color: var(--text-main); 
    font-weight: 600; 
    font-size: 0.9rem; 
    transition: var(--transition-smooth); 
}

.btn-login:hover { 
    border-color: var(--accent-calipso); 
    color: var(--accent-calipso); 
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.15); 
}

.view-container { padding: 8rem 5% 4rem; max-width: 1100px; margin: 0 auto; } 

.view-layer { display: none; opacity: 0; transform: translateY(15px); } 

.view-layer.active { 
    display: block; 
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; 
}

@keyframes fadeUp { 
    to { opacity: 1; transform: translateY(0); } 
}

.btn-primary, .btn-secondary { 
    padding: 0.85rem 2rem; 
    border-radius: 10px; 
    font-weight: 600; 
    font-size: 0.95rem; 
    transition: var(--transition-smooth); 
    display: inline-flex; 
    justify-content: center; 
    align-items: center; 
}

.btn-primary { 
    background: linear-gradient(135deg, var(--accent-calipso), var(--accent-blue)); 
    color: #fff; 
    box-shadow: 0 4px 15px rgba(0, 85, 255, 0.3); 
    border: none; 
}

.btn-primary:hover { 
    transform: translateY(-3px) scale(1.02); 
    box-shadow: 0 8px 25px rgba(0, 229, 255, 0.4); 
}

.btn-secondary { 
    background: var(--bg-surface); 
    border: 1px solid var(--border-subtle); 
    color: var(--text-main); 
}

.btn-secondary:hover { border-color: var(--accent-calipso); }

.hero-module { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    min-height: 55vh; 
    gap: 4rem; 
}

.hero-content { flex: 1.2; padding-right: 1rem; } 

.hero-content h1 { 
    font-size: 3.5rem; 
    line-height: 1.1; 
    margin-bottom: 1.5rem; 
    letter-spacing: -1px; 
    outline: none; 
}

.hero-content p { 
    font-size: 1.15rem; 
    line-height: 1.6; 
    margin-bottom: 2.5rem; 
    max-width: 100%; 
    outline: none; 
}

.cta-group { display: flex; gap: 1rem; }

.image-wrapper { 
    position: relative; 
    border-radius: 24px; 
    padding: 10px; 
    background: linear-gradient(135deg, var(--border-subtle), transparent); 
    overflow: hidden; 
}

.profile-pic { 
    width: 320px; 
    height: 320px; 
    border-radius: 20px; 
    object-fit: cover; 
    box-shadow: var(--shadow-depth); 
}

.trust-module { 
    margin-top: 4rem; 
    padding-top: 3rem; 
    border-top: 1px solid var(--border-subtle); 
    text-align: center; 
}

.small { font-size: 0.8rem; font-weight: 600; letter-spacing: 2px; } 

/* --- CARRUSEL DE EMPRESAS / MARCAS --- */
.trust-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    margin-top: 2rem;
    padding: 0 45px; 
}

.logo-grid {
    display: flex;
    align-items: center;
    gap: 3rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none; 
    -ms-overflow-style: none; 
    width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap !important;
}

.logo-grid::-webkit-scrollbar { display: none; }

.trust-item { 
    position: relative; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 8px; 
    flex: 0 0 auto; 
}

.trust-logo-wrapper { 
    position: relative; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    height: 45px; 
    width: 140px; 
}

.trust-logo { 
    height: 35px; 
    width: 100%; 
    object-fit: contain; 
    filter: brightness(0) invert(1) opacity(0.85); 
    transition: var(--transition-smooth); 
}

.trust-logo:hover { opacity: 1; transform: scale(1.05); }

[data-theme="light"] .trust-logo { filter: brightness(0) opacity(0.8); }
[data-theme="light"] .trust-logo:hover { opacity: 1; }

.trust-name { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; letter-spacing: 0.3px; }

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex; 
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-depth);
}

.carousel-btn:hover {
    color: var(--accent-calipso);
    border-color: var(--accent-calipso);
}

.carousel-btn.prev { left: 0; }
.carousel-btn.next { right: 0; }

.section-header { 
    display: flex; 
    align-items: center; 
    gap: 1.5rem; 
    margin-bottom: 3rem; 
}

.section-header h2 { font-size: 2.2rem; } 

.header-line { 
    height: 1px; 
    flex: 1; 
    background: linear-gradient(90deg, var(--border-subtle), transparent); 
}

/* --- GRID DE PROYECTOS (3 POR FILA + TARJETAS INTELIGENTES) --- */
.project-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 2rem; 
    align-items: start; /* Permite expansión fluida en hover */
}

.card-core { 
    background: var(--bg-surface); 
    border: 1px solid var(--border-subtle); 
    border-radius: 16px; 
    overflow: hidden; 
    transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease; 
    position: relative; 
    display: flex; 
    flex-direction: column; 
    box-shadow: var(--shadow-depth); 
}

.card-core:hover { 
    transform: translateY(-8px); 
    border-color: var(--accent-calipso); 
    box-shadow: 0 15px 35px rgba(0, 229, 255, 0.15);
    z-index: 5;
}

.card-img { 
    width: 100%; 
    height: 180px; 
    object-fit: cover; 
    border-bottom: 1px solid var(--border-subtle); 
}

.card-body { 
    padding: 1.5rem; 
    display: flex; 
    flex-direction: column; 
    flex: 1; 
}

.card-tag { 
    display: inline-block; 
    padding: 0.3rem 0.85rem; 
    font-size: 0.75rem; 
    font-weight: 700; 
    border-radius: 20px; 
    margin-bottom: 0.8rem; 
    letter-spacing: 0.5px; 
    align-self: flex-start; 
}

/* Título: 1 línea con elipsis en reposo, expande en hover */
.card-title { 
    font-size: 1.2rem; 
    margin-bottom: 0.4rem; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    transition: var(--transition-smooth);
}

.card-core:hover .card-title {
    white-space: normal;
    overflow: visible;
}

.card-date { 
    font-size: 0.82rem; 
    color: var(--text-muted); 
    margin-bottom: 0.8rem; 
}

/* --- AVISO DE CONFIDENCIALIDAD --- */
.confidentiality-notice {
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(90deg, rgba(18, 25, 38, 0.8), transparent);
    border-left: 3px solid var(--accent-calipso);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 2.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.confidentiality-notice .icon {
    font-size: 1.3rem;
    opacity: 0.8;
}

.confidentiality-notice strong {
    color: var(--text-main);
    font-weight: 600;
}

/* ✨ EL ARREGLO PARA EL MODO CLARO ✨ */
[data-theme="light"] .confidentiality-notice {
    background: linear-gradient(90deg, rgba(0, 85, 255, 0.08), transparent);
    border-left: 3px solid var(--accent-blue);
}

/* Descripción: 2 líneas con elipsis en reposo, expande en hover */
.card-desc { 
    font-size: 0.92rem; 
    line-height: 1.5; 
    color: var(--text-muted); 
    margin-bottom: 1.4rem; 
    display: -webkit-box; 
    -webkit-box-orient: vertical; 
    -webkit-line-clamp: 2; 
    overflow: hidden; 
    transition: var(--transition-smooth);
}

.card-core:hover .card-desc {
    -webkit-line-clamp: unset;
    display: block;
    overflow: visible;
}

.tag-storyline { color: #ff007f; background: rgba(255, 0, 127, 0.1); } 
.tag-rise { color: #ff8c00; background: rgba(255, 140, 0, 0.1); } 
.tag-web { color: #a200ff; background: rgba(162, 0, 255, 0.1); } 
.tag-video { color: #00e5ff; background: rgba(0, 229, 255, 0.1); } 
.tag-default { color: #00e5ff; background: rgba(0, 229, 255, 0.1); }

.form-wrapper { 
    max-width: 600px; 
    margin: 0 auto; 
    background: var(--bg-surface); 
    padding: 3rem; 
    border-radius: 20px; 
    border: 1px solid var(--border-subtle); 
    box-shadow: var(--shadow-depth); 
}

.form-wrapper h2 { margin-bottom: 2rem; text-align: center; font-size: 2rem; } 

.input-group { margin-bottom: 1.5rem; } 

input, select, textarea { 
    width: 100%; 
    padding: 1.2rem; 
    border-radius: 12px; 
    background: var(--bg-base); 
    border: 1px solid var(--border-subtle); 
    color: var(--text-main); 
    font-size: 1rem; 
    transition: var(--transition-smooth); 
}

input:focus, select:focus, textarea:focus { 
    border-color: var(--accent-calipso); 
    box-shadow: 0 0 0 4px rgba(0, 229, 255, 0.1); 
    outline: none; 
}

.w-full { width: 100%; } 

.text-muted { color: var(--text-muted); }

select.custom-select { 
    appearance: none; 
    -webkit-appearance: none; 
    -moz-appearance: none; 
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%2394a3b8" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>'); 
    background-repeat: no-repeat; 
    background-position: right 1rem center; 
    background-size: 1em; 
}

select.custom-select option { 
    background-color: #121926; 
    color: #f8fafc; 
    padding: 10px; 
}

[data-theme="light"] select.custom-select option { 
    background-color: #ffffff; 
    color: #1e293b; 
}

.modal-overlay { 
    position: fixed; 
    inset: 0; 
    background: rgba(0,0,0,0.85); 
    backdrop-filter: blur(8px); 
    display: none; 
    place-items: center; 
    z-index: 999; 
    overflow-y: auto; 
    padding: 2rem 0; 
}

.modal-core { 
    background: var(--bg-surface); 
    padding: 2.5rem; 
    border-radius: 20px; 
    width: 90%; 
    max-width: 450px; 
    position: relative; 
    border: 1px solid var(--border-subtle); 
    box-shadow: var(--shadow-depth); 
    margin: auto; 
}

.close-modal { 
    position: absolute; 
    top: 1.2rem; 
    right: 1.5rem; 
    font-size: 1.2rem; 
    color: var(--text-muted); 
    transition: color 0.3s; 
    z-index: 1000; 
}

.close-modal:hover { color: var(--text-main); }

.player-modal { 
    width: 90vw !important; 
    max-width: 1280px !important; 
    padding: 0 !important; 
    background: #000 !important; 
    border: 1px solid var(--border-subtle); 
    overflow: hidden; 
    border-radius: 12px; 
}

.player-modal .close-modal { display: none !important; } 

.player-header { 
    display: flex; 
    justify-content: flex-end; 
    padding: 12px 20px; 
    background: #0a0a0a; 
    border-bottom: 1px solid #222; 
    gap: 20px; 
}

.player-header button { 
    color: #888; 
    font-size: 1.3rem; 
    transition: var(--transition-smooth); 
}

.player-header button:hover { color: var(--accent-calipso); }

.iframe-container { width: 100%; aspect-ratio: 16 / 9; background: #000; } 

.iframe-container iframe, .iframe-container video { 
    width: 100%; 
    height: 100%; 
    border: none; 
}

.iframe-container.fullscreen { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh; 
    z-index: 10000; 
}

.login-wrapper { text-align: center; } 
.login-wrapper h2 { margin-bottom: 2rem; } 
.pass-group { position: relative; } 

.toggle-pass { 
    position: absolute; 
    right: 15px; 
    top: 50%; 
    transform: translateY(-50%); 
    color: var(--text-muted); 
}

body.admin-mode { border-top: 3px solid var(--accent-calipso); } 

body.admin-mode .editable-node { 
    border: 1px dashed rgba(0, 229, 255, 0.5); 
    border-radius: 8px; 
    padding: 4px; 
    cursor: text; 
    transition: var(--transition-smooth); 
}

body.admin-mode .editable-node:hover { 
    background: var(--bg-surface); 
    border-color: var(--accent-calipso); 
}

.admin-only { display: none !important; } 
body.admin-mode .admin-only { display: flex !important; }

.card-actions { 
    position: absolute; 
    top: 1rem; 
    right: 1rem; 
    display: flex; 
    gap: 0.5rem; 
    z-index: 10; 
}

.card-actions button { 
    background: rgba(0,0,0,0.7); 
    border: 1px solid rgba(255,255,255,0.2); 
    padding: 0.5rem; 
    border-radius: 8px; 
    font-size: 1rem; 
    backdrop-filter: blur(5px); 
}

.card-actions button:hover { 
    border-color: var(--accent-calipso); 
    transform: scale(1.1); 
}

.btn-edit-overlay { 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    background: rgba(0,0,0,0.8); 
    border: 1px solid var(--accent-calipso); 
    color: #fff; 
    padding: 0.8rem 1.5rem; 
    border-radius: 30px; 
    font-weight: bold; 
    cursor: pointer; 
    backdrop-filter: blur(5px); 
}

.btn-edit-overlay:hover { 
    background: var(--accent-calipso); 
    color: #000; 
}

.admin-hud { 
    position: fixed; 
    bottom: 2rem; 
    left: 50%; 
    transform: translateX(-50%) translateY(150px); 
    background: rgba(10, 14, 23, 0.85); 
    backdrop-filter: blur(20px); 
    border: 1px solid rgba(0, 229, 255, 0.3); 
    border-radius: 50px; 
    padding: 0.8rem 1.5rem; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    gap: 2rem; 
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 229, 255, 0.1); 
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); 
    z-index: 1000; 
}

body.admin-mode .admin-hud { transform: translateX(-50%) translateY(0); } 

.hud-status { display: flex; align-items: center; gap: 10px; } 

.status-dot { 
    width: 10px; 
    height: 10px; 
    background: var(--accent-calipso); 
    border-radius: 50%; 
    box-shadow: 0 0 8px var(--accent-calipso); 
    animation: pulse 2s infinite; 
}

@keyframes pulse { 
    0% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.4); } 
    70% { box-shadow: 0 0 0 10px rgba(0, 229, 255, 0); } 
    100% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0); } 
}

/* --- FOOTER Y AVISO DE TRADUCCIÓN --- */
.site-footer {
    text-align: center;
    padding: 3rem 5% 2rem;
    margin-top: 2rem;
    border-top: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 0.85rem;
    width: 100%;
}

/* Oculto por defecto, se muestra solo si Google traduce la web */
.translate-notice {
    display: none; 
    margin-top: 0.8rem;
    font-size: 0.8rem;
    color: var(--accent-calipso);
}

.translate-notice button {
    color: var(--text-main);
    text-decoration: underline;
    font-weight: 600;
    margin-left: 5px;
    transition: var(--transition-smooth);
}

.translate-notice button:hover {
    color: var(--accent-calipso);
}

/* El interruptor mágico: Google añade esta clase al HTML */
html.translated-ltr .translate-notice {
    display: block;
}

/* Opcional: Oculta la barra superior gris fea que pone Google por defecto */
.skiptranslate iframe { display: none !important; }
body { top: 0 !important; }

/* --- ADAPTACIÓN MÓVIL Y TABLET --- */ 
@media (max-width: 992px) {
    .project-grid { grid-template-columns: repeat(2, 1fr); } 
}

@media (max-width: 768px) { 
    .nav-core { 
        padding: 0.8rem 3%; 
        gap: 0.5rem;
    } 
    
    .brand { 
        font-size: 0.95rem; 
        max-width: 100px; /* Evita que el nombre de tres líneas empuje todo */
        line-height: 1.1;
    } 
    
    .nav-links { 
        gap: 0.5rem; /* Reducimos el espacio entre elementos */
        align-items: center; 
    } 
    
    .nav-item {
        font-size: 0.85rem; /* Letras un poquito más compactas en celular */
    }

    /* Botón de idioma más compacto para móvil */
    #lang-toggle {
        padding: 0.3rem 0.5rem !important;
        font-size: 0.75rem !important;
    }

    .view-container { padding-top: 10rem; } 
    .hero-module { flex-direction: column; text-align: center; gap: 2rem; min-height: auto; } 
    .hero-content { display: flex; flex-direction: column; } 
    .hero-content h1 { order: 1; font-size: 2.3rem; margin-bottom: 1rem; } 
    .hero-visual { order: 2; margin: 1rem auto; } 
    .hero-content p { order: 3; font-size: 1rem; margin: 0 auto 2rem auto; } 
    .cta-group { order: 4; flex-direction: column; width: 100%; justify-content: center; } 
    .cta-group button { width: 100%; } 
    .profile-pic { width: 220px; height: 220px; } 
    .logo-grid { gap: 1.5rem; } 
    
    /* Forzamos al botón de login a mostrarse compacto (solo el candado) */
    .btn-login { padding: 0.4rem 0.5rem; } 
    .btn-login .text-login-text { display: none; } 
    
    .project-grid { grid-template-columns: 1fr; } 
}